retreive image from database

  • Thread starter Jean Christophe Avard
  • Start date
J

Jean Christophe Avard

Hi! I have a dataset where I have a field that is a image. I can't figure
out how to retreive the imahe, I get the invalid paranmeter with this
code...

Try

Dim buffer() As Byte = CType(dstPlant.Tables("plant").Rows(intRow)("image"),
Byte())

'create memory stream from this array of bytes

Dim mstImage As New MemoryStream(buffer)

'set the image property of the picture box to the image in the stream

file.pictFile.Image = Image.FromStream(mstImage)

Catch ex As Exception

MessageBox.Show("KJHKJHKJH" + ex.Message.ToString)

End Try



anyone can help me?
 
K

Ken Tucker [MVP]

Hi,

http://www.windowsformsdatagridhelp.com/default.aspx?ID=f6d5cc8c-a917-482b-ab1d-253a1ec85fc3

Ken
----------------------
Hi! I have a dataset where I have a field that is a image. I can't figure
out how to retreive the imahe, I get the invalid paranmeter with this
code...

Try

Dim buffer() As Byte = CType(dstPlant.Tables("plant").Rows(intRow)("image"),
Byte())

'create memory stream from this array of bytes

Dim mstImage As New MemoryStream(buffer)

'set the image property of the picture box to the image in the stream

file.pictFile.Image = Image.FromStream(mstImage)

Catch ex As Exception

MessageBox.Show("KJHKJHKJH" + ex.Message.ToString)

End Try



anyone can help me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top