This is my code:
byte[] imgg = (byte[])(myReader["StudPic"]);
if (imgg == null)
{
pictureBox11.Image = defaultpic;
}
else
{
MemoryStream mstream = new MemoryStream(imgg);
pictureBox11.Image = Image.FromStream(mstream);
}
I got this error: unable to cast object of type system.dbnull to type system.byte[]
Data type is Blob. But if it has a value, it works fine, it fetches the image.