Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


    Call ImageRetrieve()

End Sub

Private Sub ImageRetrieve()
    imgsave2.Update()
    Dim OleDbConnection1 As New System.Data.OleDb.OleDbConnection("PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=D:\Testing\DATABASE\TESTING.MDB;PERSIST SECURITY INFO=FALSE;")
    OleDbConnection1.Open()
    Dim OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand()
    Dim OleDbReader1 As System.Data.OleDb.OleDbDataReader

    'Access (OleDb)
    OleDbSelectCommand1.CommandText = "Select h1_img,h2_img,h3_img,h1_sign,h2_sign,h3_sign from vLOCKER WHERE lockerno = " & TextBox1.Text & ""
    OleDbSelectCommand1.Connection = OleDbConnection1

    ' RUN THE COMMAND
    OleDbReader1 = OleDbSelectCommand1.ExecuteReader()
    OleDbReader1.Read()
    Dim Len1 As Long = OleDbReader1.GetBytes(0, 0, Nothing, 0, 0)
    Dim Array1(CInt(Len1)) As Byte
    OleDbReader1.GetBytes(0, 0, Array1, 0, CInt(Len1))

    OleDbConnection1.Close()

    Dim MemoryStream1 As New System.IO.MemoryStream(Array1)
    Dim Bitmap1 As New System.Drawing.Bitmap(MemoryStream1)
    imgsave2.Image = Bitmap1
End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click


Call ImageRetrieve()

End Sub

Private Sub ImageRetrieve()
imgsave2.Update()
Dim OleDbConnection1 As New System.Data.OleDb.OleDbConnection("PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=D:\Testing\DATABASE\TESTING.MDB;PERSIST SECURITY INFO=FALSE;")
OleDbConnection1.Open()
Dim OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand = New System.Data.OleDb.OleDbCommand()
Dim OleDbReader1 As System.Data.OleDb.OleDbDataReader

'Access (OleDb)
OleDbSelectCommand1.CommandText = "Select h1_img,h2_img,h3_img,h1_sign,h2_sign,h3_sign from vLOCKER WHERE lockerno = " & TextBox1.Text & ""
OleDbSelectCommand1.Connection = OleDbConnection1

' RUN THE COMMAND
OleDbReader1 = OleDbSelectCommand1.ExecuteReader()
OleDbReader1.Read()
Dim Len1 As Long = OleDbReader1.GetBytes(0, 0, Nothing, 0, 0)
Dim Array1(CInt(Len1)) As Byte
OleDbReader1.GetBytes(0, 0, Array1, 0, CInt(Len1))

OleDbConnection1.Close()

Dim MemoryStream1 As New System.IO.MemoryStream(Array1)
Dim Bitmap1 As New System.Drawing.Bitmap(MemoryStream1)
imgsave2.Image = Bitmap1
End Sub

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.