SqlReader.GetBytes() and length of varbinary column

  • Thread starter Thread starter John Grandy
  • Start date Start date
J

John Grandy

Does SqlReader.GetBytes() reliably always return the total number of bytes
in a varbinary column ?


// establish sqlReader

using ( sqlReader )
{
int ordinal = sqlReader.GetOrdinal("VarBinaryColumn");
byte[] data = null;

if ( !sqlReader.IsDBNull(ordinal ) )
{
long length = sqlReader.GetBytes(ordinal, 0, null, 0, 0);
// ... etc.
}
}
 
Back
Top