<分区>
这是我的代码:
byte[] imgg = (byte[])(myReader["StudPic"]);
if (imgg == null)
{
pictureBox11.Image = defaultpic;
}
else
{
MemoryStream mstream = new MemoryStream(imgg);
pictureBox11.Image = Image.FromStream(mstream);
}
我收到此错误:无法将类型为 system.dbnull 的对象转换为类型为 system.byte[]
数据类型为 Blob。但如果它有一个值,它就可以正常工作,它会获取图像。