SqlReader.GetBytes() and length of varbinary column

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.
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top