I have saved an image in database using following code.
ofd.ShowDialog()
vrPicHolder = IO.File.ReadAllBytes(ofd.FileName)
Dim drPic As DataRow
drPic = DsPic.tblPicTest.NewRow
drPic.Item("Picture") = vrPicHolder
DsPic.tblPicTest.Rows.Add(drPic)
taPic.Update(DsPic.tblPicTest)
Now I want to display this image in a picture box. I tried
PictureBox1.Image = Image.FromFile(vrPicHolder)
But it says can not convert Byte() to string. Please advise how to load this picture.
Thanks
Furqan
The method you’re calling expects a string that’s the filename of an image. You need to pass it the filename of an image that is a BMP, GIF, JPEG, PNG or TIFF format.
Image.FromFile Method (String)
What you should be doing is this:
Image.FromStream Method (Stream)