【发布时间】:2017-02-22 02:50:39
【问题描述】:
这是我的代码:
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。但如果它有一个值,它就可以正常工作,它会获取图像。
【问题讨论】: