G
Guest
Hi
I have to write images(.gif/.bmp/.jpg/.ico), to db and read them. Uploading
images to db works fine for me. Reading from db to byte[] is also ok. But,
when I try to display them in my form controls, I get this error.
This is how it goes :
<code>
byte[] bImage1 = (byte[])datasetImageList.Tables["IMAGE"].Rows[0]["IMAGE1"];
System.IO.MemoryStream ms = new MemoryStream(bImage1, 0, bImage1.Length);
this.lblRunImage.Image = System.Drawing.Image.FromStream(ms); // Exception
occurs here.
</code>
I have tested this with .gif and .bmp and it does not work in either case.
Please help me...
Thanks.
I have to write images(.gif/.bmp/.jpg/.ico), to db and read them. Uploading
images to db works fine for me. Reading from db to byte[] is also ok. But,
when I try to display them in my form controls, I get this error.
This is how it goes :
<code>
byte[] bImage1 = (byte[])datasetImageList.Tables["IMAGE"].Rows[0]["IMAGE1"];
System.IO.MemoryStream ms = new MemoryStream(bImage1, 0, bImage1.Length);
this.lblRunImage.Image = System.Drawing.Image.FromStream(ms); // Exception
occurs here.
</code>
I have tested this with .gif and .bmp and it does not work in either case.
Please help me...
Thanks.