I am using following code to get data from database and load to picture box
Dim vrPicFromDB = IO.File.ReadAllBytes(DsPic.tblPicTest.Item("Picture"))
Dim ms As New MemoryStream(vrPicFromDB)
PictureBox1.Image = Image.FromStream(ms)
It gives error on DsPic.tblPicTest.Item(“Picture”)) portion of the statement.
I also tried
CByte(DsPic.tblPicTest.Item("Picture")))
but it gives the same error.
Please advise how to fix it.
Thanks
Furqan
Assuming that the “Picture” column is an Image column in the database, your line to load the vrPicFromDB byte array will look something like this:
That line assume you have loaded at least 1 row of data.