I have already convert a picture box to byte then insert into database as image datatype.
I need to preview it on to the picturebox again when datagrid cellclick event.
string stimg = "select images from tb_employee where Boolean='True' and id='" + classinfo.eid + "'";
DataTable dtimg = ClassConnection.getdata(stimg, "tbname");
if (dtimg.Rows.Count == 1)
{
try
{
MemoryStream ms;
byte[] bviewimg = (byte[])dtimg.Rows[0]["images"];
ms = new MemoryStream(bviewimg);
ms.Seek(0, SeekOrigin.Begin);
picem.Image = Image.FromStream(ms);
}
catch
{
picem.Image = null;
}
}
this doesn't work for me .
What I can do next??
Any body has idea to solve this problem, please share it to me?>
thank you in advance.