bommelding Posted January 22, 2006 Posted January 22, 2006 I am trying to retrieve a picture that is stored in an access db with the following code: MyConnection.Open() Dim MyCommand As New OleDbCommand("SELECT * FROM tblwater WHERE waterid=" & wateren.waterid, MyConnection) MyReader = MyCommand.ExecuteReader() MyReader.Read() txtnaam.Text = MyReader("water_naam") txtplaats.Text = MyReader("water_plaats") txttype.Text = MyReader("water_soort") txtomschrijving.Text = MyReader("water_omschrijving") txtopp.Text = MyReader("water_opp") 'foto ophalen Dim bytBLOBData(MyReader.GetBytes(1, 7, Nothing, 0, Integer.MaxValue) - 1) As Byte MyReader.GetBytes(1, 0, bytBLOBData, 0, bytBLOBData.Length) Dim stmBLOBData As New MemoryStream(bytBLOBData) waterfoto.Image = Image.FromStream(stmBLOBData) MyConnection.Close() At myreader.getbytes I get an error, does anyone know what I should do to make it work? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.