Need help: retrieving an image from Access and give it to a PictureBox
Hello all,
Don't know if this is the right place to ask but I figure it might be the closest.
I have an Access database (.mdb) and one of the tables contain binary image files. I want to retrieve these images and put them into a PictureBox object. I am using the get_Item(X) method of OleDbDataReader class, which returns an generic Object (and using watch, it is a ubyte array).
How to I convert this to an Image object so I can pass it to the PictureBox set_Image method? Or is there a better way to do things?
Any help would be greatly appreciated.
Regards
Re: Need help: retrieving an image from Access and give it to a PictureBox
You can try writing it to a file and then loading the image from the file into the picturebox. I've seen code in Visual Basic that does this (http://www.vbforums.com/showthread.php?t=346752) so you should be able to do the equivelant :)
Re: Need help: retrieving an image from Access and give it to a PictureBox
Not sure, but I believe you can create a byte array and then use the toolkit to create an image from that.
Re: Need help: retrieving an image from Access and give it to a PictureBox
If not the Toolkit, then ImageIO. However, I believe you're in the wrong forum. There's no datatype called ubyte in Java, so either you're using C# (has its own forum) or J# (questions asked best go to generic .Net).