Results 1 to 4 of 4

Thread: Need help: retrieving an image from Access and give it to a PictureBox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    22

    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

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    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


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    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.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    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).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width