Rudy - the problem with storing the images is that you don't know for sure
how big the thing could grow in most instance. Today 5,000 - tomorrow maybe
it turns into 10,000. It's a lot easier to buy network storage than to
accomodate the cahnge in the databse. + you can't use indexes on blob
fields. If you have 5,000 images, then I would avoid using Blobs - having
done it in the past. Let me put it this way - the benefit of being 'right'
about storing in the db is virtually indistinguishable from the benefit of a
network drive - at least as far as the end user goes. The cost of being
wrong about the db is very very high. So there's basically a lot of risk
for a very little upside. IMHO, the math doesn't add up. The exception is
cases where you absolutely don't want the images exposed to end users except
through your application and you store them in the db and then have an a33
load of security on the db. I did this at my former job w/ about 10,000
pdfs, peformance totally sucked but the images were confidential and were
accessed rarely - one thing I forgot to mention above is the frequency of
access. The less they are accessed, teh less of a risk with storing in the
db.
I'd definitely ask my DBA for his/her opinion on the subject too - mine
would probably say no way without a really compelling argument.
As far as storing paths goes, just store the path as a varchar and then use
a ExectueScalar command or fill a datatable and use either the File or
FileInfo class passing in the value to get the file reference.
--
W.G. Ryan MVP (Windows Embedded)
TiBA Solutions
www.tibasolutions.com |
www.devbuzz.com |
www.knowdotnet.com
"Rudy" <> wrote in message
news:77C3218F-65B0-41B2-9C34-...
> Hello all!
>
> I am amazed how many posts I have read to store an image in SQL, and just
as
> many against it. So I learned how to store an image in a SQL db and
retrieve
> the image. A little tricky, but not too bad. But then I thought I wanted
to
> try the other way, by putting the file location in SQL and storing the
actual
> image in another directory.
> I plan to have many images on my web application, up to as many as 5000.
> Not to mention the other tables I will have, that will have just as many
> records.
> So I think I will go the old fasion route, and just put in the path in the
> DB instead of the image.
>
> Do I dare ask? What do you think is the best way to go?
>
> Second thing is, I have found a ton of articles on how to store the image,
> but can't find any that shows an example of just storing the file path.
If
> somebody would have an example of this, or point me in a direction, that
> would be great!
>
> Thanks for all your help!!!
>
> Rudy