Using a relative path to point to image

maynard

Member
Joined
Nov 17, 2009
Messages
15
Programming Experience
Beginner
Anyone know how this can be done within SQL 2008? I want each row to point to a different image using a relative path. Not to sure what data type to use and how the relative path should be formated. Any help would be appreciated.
 
Yeah, I'm using VB to build this application. I'm not to sure where to put the image. Would it be best to throw them into the VB project folder and create an image folder within that folder? In SQL when I use a path to this image would I include the C:\? or just images/image.jpg?
 
I would include them in your project's output folder (like I mentioned above) and then use a picturebox to display the necessary pictures.

I've done something before where I've had a picturebox that has something like
.image = "C:\My Project\Images\" & me.txtName.text & ".jpg"

As long as an image exists in that folder with a name matching the txtName field then the picture will be displayed (you will need to refresh the code when browsing more than one row)

In theory you therefore don't need a column in SQL to say where the picture is. Instead you put the pictures in the folder and match to a variable on your row. Even ID (1.jpg, 2.jpg etc)

That may not be exactly what you are looking for, but may help :)
 
Back
Top