GetChars(int, long, char[], int, int) Method

Syntax:

public long GetChars(int ordinal, long dataOffset, char[] buffer, int bufferOffset, int length)

Description:

Reads up to length characters from the column ordinal, starting at the location indicated by dataOffset, into buffer starting at bufferOffset. If less characters are available in the column, only that number of characters will be read and the return value will indicate how many were actually read.

Parameters:

ordinal

Type: System.Int32

The zero-base column ordinal.

dataOffset

Type: System.Int64

The index within the column from which to being the read operation.

buffer

Type: System.Byte[]

The buffer into which to copy the data.

bufferOffset

Type: System.Int32

The index within buffer where the data will be copied.

length

Type: System.Int32

The maximum number of characters to read.

Return Value:

Type: System.Int32

The actual number of characters read.

Exceptions:

Exception Condition
ArgumentNullException The specified buffer is null.
ArgumentException The dataOffset is less than zero
InvalidOperationException The RdmDataReader is closed or there is no current row.
ArgumentOutOfRangeException The bufferOffset is less than zero or bufferOffset plus length is greater than the length of buffer.

Reference:

For more information, reference MSDN documentation for: System.Data.Common.DbDataReader.GetChars