I am using RadBinaryImage control with SqlDataSource. If the VarBinary field contains a NULL value I am getting this error: “Unable to cast object of type 'System.DBNull' to type 'System.Byte' “.
My understanding is that a NULL field should be cast to a null or empty byte.
Can someone please show me how check if the supplied value is of type DBNull and how to change it to appropriate empty byte array or null in C#?
9 Answers, 1 is accepted
or do it dynamically: