GetBytes(int, long, byte[], int, int) Method

Syntax:

public long GetBytes(int ordinal, long dataOffset, byte[] buffer, int bufferOffset, int length)

Description:

Reads up to length bytes from the column ordinal, starting at the location indicated by dataOffset, into buffer starting at bufferOffset. If less bytes are available in the column, only that number of bytes 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 bytes to read.

Return Value:

Type: System.Int32

The actual number of bytes 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.GetBytes