retrieve image from sql server in picturebox
- by user3116296
I have saved a picture in sql server and now i can not to retrieve image and set it's in picturebox with linq.
why byte[] x become null?
private void dataGridViewUser_CellClick(object sender, DataGridViewCellEventArgs e)
{
DataGridViewRow row = dataGridViewUser.CurrentRow;
byte[] x=(byte[])row.Cells["Image"].Value;
MemoryStream ms1 = new MemoryStream(x);
picuser.Image = Bitmap.FromStream(ms1);
}