read
this[
^].
in the given link they do:
byte[] ImageByte = null;
MemoryStream MemStream = null;
PictureBox PicBx = new PictureBox();
object OB;
string WorkingDirectory = Application.StartupPath + "\\";
connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + WorkingDirectory + "DBFile.mdb; Persist Security Info=True";
cnction = new OleDbConnection(connString);
cnction.Open();
int ImageID = 6;
sqlCommand = "SELECT ImageObject FROM ImagesTable WHERE ImageID = " + ImageID + "";
comm = new OleDbCommand(sqlCommand, cnction);
ImageByte = comm.ExecuteScalar();
MemStream = new MemoryStream(ImageByte);
PicBx.Image = Image.FromStream(MemStream);
}
and maybe set
vcon.Close();
after
load_picturebox.Image = Image.FromStream(stream);
Sometimes a closed datasource can bring you into trouble
One question :
in your source you use
(byte[])ds.Tables[0].Rows[0].ItemArray[0];
Is ItemArray[0] needed ??
is
(byte[])ds.Tables[0].Rows[0];
not enough?