Home All Groups Group Topic Archive Search About

Binding an Image to a picturebox

Author
11 Aug 2006 2:43 PM
Ryan
I have a very basic form that has controls bound to a SQL 2005 database for
an Employee Directory.  I'm using a PictureBox control to bind to the
"Photo" field which is of datatype image.  However, it doesn't seem to work.
It does not display the image from the database (it's blank).  Also, when I
use a function to upload a new image, it displays correctly but shows
regardless of which record I am on.  It then does not save to the database
on the dataset update command.

Help!'
Thanks,
Ryan

Author
11 Aug 2006 2:55 PM
Ryan
Nevermind it was some problem with the data imported from another database.
I cleared the photo field for all records and it works fine now (uploading
and saving).

Sorry!
Ryan

Show quoteHide quote
"Ryan" <Tyveil@newsgroups.nospam> wrote in message
news:OFnD6RVvGHA.5056@TK2MSFTNGP06.phx.gbl...
>I have a very basic form that has controls bound to a SQL 2005 database for
>an Employee Directory.  I'm using a PictureBox control to bind to the
>"Photo" field which is of datatype image.  However, it doesn't seem to
>work. It does not display the image from the database (it's blank).  Also,
>when I use a function to upload a new image, it displays correctly but
>shows regardless of which record I am on.  It then does not save to the
>database on the dataset update command.
>
> Help!'
> Thanks,
> Ryan
>
Author
11 Aug 2006 3:12 PM
Paul Clement
On Fri, 11 Aug 2006 09:43:21 -0500, "Ryan" <Tyveil@newsgroups.nospam> wrote:

¤ I have a very basic form that has controls bound to a SQL 2005 database for
¤ an Employee Directory.  I'm using a PictureBox control to bind to the
¤ "Photo" field which is of datatype image.  However, it doesn't seem to work.
¤ It does not display the image from the database (it's blank).  Also, when I
¤ use a function to upload a new image, it displays correctly but shows
¤ regardless of which record I am on.  It then does not save to the database
¤ on the dataset update command.

See the following:

HOW TO: Copy a Picture from a Database Directly to a PictureBox Control with Visual Basic .NET
http://support.microsoft.com/?kbid=317670


Paul
~~~~
Microsoft MVP (Visual Basic)