tags:

views:

313

answers:

1

How can I display an image in C# or VB when the name is in a database?

I am using visual studio 2008 VB or C#

I want to display an image on a windows form The image name is in a SQL2005 Database The image is stored in a directory structure.

Ideally I would also like to be able to browse a directory select an image and add the image name to SQL2005 and add the image into the directory structure for new records

+3  A: 

in C#, use a PictureBox... Then to load the image you can use:

pictureBox1.Image = Image.FromFile("c:\\filename.jpg");

replace the file name and path with the value loaded from the database

KM