GetBytes Method

Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset.

Syntax

long GetBytes( int ordinal, long dataIndex, byte[ ] buffer, int bufferIndex, int length )

Parameters

Return Value

The number of bytes read.

Implements

IDataRecord.GetBytes

Usage

  • GetBytes returns the number of available bytes in the field. In most cases, this is the exact length of the field. However, the number returned can be less than the true length of the field if GetBytes has already been used to obtain bytes from the field. This can be the case, for example, when the AseDataReader class is reading a large data structure into a buffer.

  • If you pass a buffer that is a null reference (“Nothing” in Visual Basic), GetBytes returns the length of the field in bytes.

  • No conversions are performed. Use this method to retrieve data from columns of type image, binary, timestamp, and varbinary.