Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Image storage

Author  Topic 

PaulNeil
Starting Member

9 Posts

Posted - 2007-06-19 : 12:01:02
I have recently designed and built my first database using SQL server 2005 express. I have included an image (BLOB) column in one of the database tables. This is a bad idea according to some experts, and some say it is OK!

I am currently carrying out a trial with just 3 pictures via Visual Basic 2005 express forms, and there is no problem so far as the images are displayed for each record. But I anticipate between 300 - 1000 images for the table, and this could pose real problems for SQL server 2005 express and Visual Basic 2005 express, I guess.

I have just been reading that the cost of storing large images in the database is too high! I have also read it's better to store images (BLOB) into the file system because it is cheaper to store them no matter how many there are.

But the question is how I can reference an image in this path: C:\Picture\Product\Grocery\00052745.jpg in the database table, so that when I select a record Visual Basic 2005 forms the image is displayed accordingly, similar as when stored directly in the database table? Your help very much appreciated.

Kristen
Test

22859 Posts

Posted - 2007-06-19 : 12:21:02
"how I can reference an image in this path: C:\Picture\Product\Grocery\00052745.jpg in the database table, so that when I select a record Visual Basic 2005 forms the image is displayed accordingly"

Well, you retrieve the File Path from the database, and then you need to write a routine in your application to get the file from its location on the disk (instead of from a BLOB column in the database).

If you were building a web site, instead, you would only have to output:

Response.Write("<img src='" & strMyImagePath & "'>")

to create a "tag" on a web page that pointed to the image. For a VB application its a bit harder I expect!

I don't suppose this adds anything to the research you have already done, but just in case here's the link:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=Image,Images

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-20 : 05:16:30
Also see: http://www.aspfaq.com/show.asp?id=2149

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -