myconn.Open()
MySQLstring1 = "select picture from naw where id = 17"
myCommand1.Connection = myconn
myCommand1.CommandText = MySQLstring1
myReader = myCommand1.ExecuteReader
If Not myReader.HasRows Then
MsgBox("now rows found")
Exit Sub
End If
If myReader.Read Then
Dim imgByteArray() As Byte
imgByteArray = CType(myReader.Item("picture"), Byte())
Dim MyStream As New System.IO.MemoryStream(imgByteArray)
PictureBox1.Image = Image.FromStream(MyStream)
MyStream.Close()
End If
myReader.Close()
myconn.Close()
dre-logics -1 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.