retrieve image from sql server in picturebox
Posted
by
user3116296
on Stack Overflow
See other posts from Stack Overflow
or by user3116296
Published on 2014-06-03T09:21:13Z
Indexed on
2014/06/03
9:24 UTC
Read the original article
Hit count: 246
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);
}
© Stack Overflow or respective owner