SqlCeResultSet.GetChars 方法

从指定字段中的指定位置开始,将一定长度的字符复制到缓冲区中。

命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 system.data.sqlserverce.dll 中)

语法

声明
Public Overrides Function GetChars ( _
    ordinal As Integer, _
    dataIndex As Long, _
    buffer As Char(), _
    bufferIndex As Integer, _
    length As Integer _
) As Long
用法
Dim instance As SqlCeResultSet
Dim ordinal As Integer
Dim dataIndex As Long
Dim buffer As Char()
Dim bufferIndex As Integer
Dim length As Integer
Dim returnValue As Long

returnValue = instance.GetChars(ordinal, dataIndex, buffer, bufferIndex, length)
public override long GetChars (
    int ordinal,
    long dataIndex,
    char[] buffer,
    int bufferIndex,
    int length
)
public:
virtual long long GetChars (
    int ordinal, 
    long long dataIndex, 
    array<wchar_t>^ buffer, 
    int bufferIndex, 
    int length
) override
public long GetChars (
    int ordinal, 
    long dataIndex, 
    char[] buffer, 
    int bufferIndex, 
    int length
)
public override function GetChars (
    ordinal : int, 
    dataIndex : long, 
    buffer : char[], 
    bufferIndex : int, 
    length : int
) : long
不适用。

参数

  • ordinal
    字段中将从其检索数据的序号位置。
  • dataIndex
    字段中将从其开始复制的偏移量(以字符为单位)。
  • buffer
    作为数据复制目标的缓冲区。
  • bufferIndex
    缓冲区中将从其开始复制的偏移量。
  • length
    要复制的最大字节数。

返回值

复制的实际字符数。

备注

此函数返回复制的实际字符数;如果已到达字段的结尾,则实际字符数可能小于请求的长度。

如果传入一个空缓冲区,则 GetChars 以字符为单位返回字段的长度。

如果使用 SequentialAccess 命令行为执行此命令,则调用 GetChars 时必须指定按顺序递增读取,否则将会引发异常。

如果在指定的序号位置不存在任何字段,则会引发异常。

平台

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Windows Vista、Microsoft Windows XP SP2 和 Windows Server 2003 SP1 支持 Microsoft .NET Framework 3.0。

版本信息

.NET Framework

受以下版本支持:3.0

.NET Compact Framework

受以下版本支持:2.0

请参见

参考

SqlCeResultSet 类
SqlCeResultSet 成员
System.Data.SqlServerCe 命名空间