0
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

Edited by Reverend Jim: wrong category

1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by SANJAY26
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.