Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLite - .NET 编程 » UltraLite .NET 2.0 API 参考 » ULDataReader 类

 

GetChars 方法

从指定的偏移量开始,将指定的 ULDbType.LongVarchar 列的值的子集复制到目标 System.Char 数组的指定偏移量处。

语法
Visual Basic
Public Overrides Function GetChars( _
   ByVal columnID As Integer, _
   ByVal srcOffset As Long, _
   ByVal dst As Char(), _
   ByVal dstOffset As Integer, _
   ByVal count As Integer _
) As Long
C#
public override long GetChars(
   int columnID,
   long srcOffset,
   char[] dst,
   int dstOffset,
   int count
);
参数
  • columnID   列的 ID 号。值必须在 [0,ULDataReader.FieldCount-1] 范围内。游标中第一列的 ID 值为 0。

  • srcOffset   列值的起始位置。该值从零开始。

  • dst   目标数组。

  • dstOffset   目标数组的起始位置。

  • count   要复制的字符数。

返回值

实际复制的字符数。

注释

如果传递一个为空值引用(在 Visual Basic 中是 Nothing)的 dst 缓冲区,GetChars 会以字符为单位返回该字段的长度。

位于值的 srcOffsetsrcOffset+count-1 之间的字符将被逐个复制到目标数组的 dstOffsetdstOffset+count-1 位置处。如果在复制完 count 个字符之前就到达了值尾,则目标数组的剩余部分保持不变。

如果出现以下任一情况,则抛出代码为 ULSQLCode.SQLE_INVALID_PARAMETER 的 ULException,并且不会修改目标:

对于其它错误,抛出具有相应错误代码的 ULException。

另请参见