ez skd

ez skd

  • NA
  • 1
  • 0

Getting image from database

Mar 13 2010 4:21 AM
Hi everyone!
I am trying to retrieve image from database. My code is as below. but it gives error.
DataTable tab = obj.createtable("Select pics from picto");

byte[] ImgByte = (byte[])tab.Rows[0][0];
FileStream fs = new FileStream("test.GIF", FileMode.Create);
fs.Write(ImgByte, 0, ImgByte.Length);
fs.Close();
fs = null;
pictureBox2.Image = Image.FromFile("test.GIF");


The last line give this error "Out of memory"
Plz help me.

Answers (1)