1

I'm getting the following error and I'm having some difficulty on how I can write the following snippet of code bellow to prevent the following error before casting, I tried the following solution and no luck...

Error: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]

byte[] pictureAsByteArray = (byte[])reader.GetValue(ordinals.GetOrdinal("xxxSignature"));

Solution Doesn't work:

if ((reader.GetValue(ordinals.GetOrdinal("xxxSignature")!= null))
else() then casting
maccettura
  • 10,514
  • 3
  • 28
  • 35
Stacey
  • 63
  • 8

0 Answers0