SqlCommand sqlCmd = new SqlCommand("SELECT imageContent FROM printerBarCode pbc,PlantLayout pl WHERE pbc.Department=pl.Department,pbc.Location=pl.Location", con); SqlDataAdapter SDA1 = new SqlDataAdapter(sqlCmd); DataSet ds = new DataSet(); SDA1.Fill(ds, "PlantLayout"); int c = ds.Tables["Plantlayout"].Rows.Count; { //BLOB is read into Byte array, then used to construct MemoryStream, //then passed to PictureBox. Byte[] byteBLOBData = new Byte[0]; byteBLOBData = (Byte[])(ds.Tables["PlantLayout"].Rows[c - 1]["imageContent"]); MemoryStream stmBLOBData = new MemoryStream(byteBLOBData); pictureBox1.Image = Image.FromStream(stmBLOBData); }
MemoryStream stmBLOBData = new MemoryStream(byteBLOBData); pictureBox1.Image = Image.FromStream(stmBLOBData); Bitmap bmpImage = new Bitmap(ms); pictureBox1.Image = bmpImage ;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)