می خوام عکسی رو که از sql server جستجو کردم تو یه picture box نشون بدم. برای اینکارbuffer1 = (byte[])(objdataset.Tables["tbl_caramuz"].Rows[objcm.Position]["pic"]);
کد زیر رو می نویسم
MemoryStream objstream = new MemoryStream(buffer1);
PictureBox objbox =PictureBox1;
objbox.Image = Image.FromStream(objstream);
objbox = null;
objstream.Close();
اما error زیر رو میده
Unable to cast object of type ‘system.DBNull’ to type ‘system.Byte[]’