GetByteArray(string)

This method returns the byte array value of the specified numeric column.

Declaration

// C#
public override byte[] GetByteArray(string name);

Parameters

  • name

    The specified column name

Return Value

The value of the column as a byte array.

Exceptions

InvalidOperationException - The connection is closed, the reader is closed, Read() has not been called, or all rows have been read.

IndexOutOfRangeException - The column index is invalid.

InvalidCastException - The accessor method is invalid for this column type, the column is a sparse vector type, or the column value is NULL.

Remarks

While this accessor can retrieve data from columns of any numeric format, it is the only accessor for retrieving byte[] for BINARY format columns.

IsDBNull should be called to check for NULL values before calling this method.

You cannot call this method on a sparse VECTOR column.