I have this line of code
byte[] field1 = (reader.GetSqlBinary(reader.GetOrdinal("Field1")).Value;
which is a SqlDataReader
I am trying to convert the code to use the enterprise library data access block but cant figure out how to get a byte[] using the IDataReader.
I’ve had a good look through the MS docs but failed to find anything that helped.
The first thing I would try is (where
iisreader.GetOrdinal("Field1")):If that fails, perhaps:
Note also that the behaviour may change slightly depending on whether
CommandBehavior.SequentialAccessis specified.