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