qry = "" qry = "SELECT TOP 1 Image FROM T_ImageStore" cmd = New OleDbCommand(qry, conn) Dim img As Byte() = DirectCast(cmd.ExecuteScalar(), Byte()) Dim ms As MemoryStream = New MemoryStream(img) PictureBox1.Image = Image.FromStream(ms)
void DispalyImage() { SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds, "Images"); int count = ds.Tables["Images"].Rows.Count; if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { var data = (Byte[])(ds.Tables["Images"].Rows[count - 1]["Image"]); MemoryStream stream = new MemoryStream(data); pictureBox1.Image = Image.FromStream(stream); } }
Dim myMS As New IO.MemoryStream PictureBox1.Image = System.Drawing.Image.FromStream(myMS)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)