In article <uX**************@TK2MSFTNGP12.phx.gbl>, C CORDON wrote:
I have an image stored in a SQL DB how can I display it in a control on a
Windows Form?
TIA!
Well, I'm not too much of a db expert... But, what you are probably
ending up with is a feild in a dataset that amounts to a byte array -
assuming you are storing the actual image in the database. Once you
have the byte array, displaying that image in a PictureBox is actually
not that difficult... Actually, any setting any controls image
property...
You simply wrap the byte array in a System.IO.MemoryStream object and
call the Image.FromStream method. Here is some sample untested code...
Dim memStream As New MemoryStream (theByteArray)
PictureBox1.Image = Image.FromStream (memStream)
' you probably want to close the stream here...
memStream.Close ()
Anyway, HTH
--
Tom Shelton [MVP]