Re: How to store picture (*.jpg, *.bmp, *.gif) into sql database ?

C

Curt_C [MVP]

use the Image datatype, BUT... if you can, try just storing them on the
FileSystem and storing a path/name in the DB. Better/easier to deal with.
 
T

Tampa .NET Koder

I always wondered about this. I have tried storeing images in a database
and I think is kool since the data can be managed a whole lot easier.
Storeing the path in the DB is ok but you have to manage the data in the DB
and on the filesystem. Does anyone else have an opinion on this?

Tampa .NET Koder
 
S

Shan Plourde

I'm for storing files on the file system. Some of my cons are below.
There are many others and pros for doing what you're doing, and these
items could be argued, but these are my 2 cents on why I would not store
files in a database. Others would definitely have different opinions,
I'm not sure what people with clustered .NET servers would recommend for
example. Perhaps their arguments would weigh in favour of what you're
doing. My perspective is from the simple .NET server and DB server
architecture.

1. No need for large files to be processed through .NET process space.
If you store files in your database, the files must be streamed through
the .NET framework before being returned to clients - definitely unnecessary
2. More network bandwidth consumed between your .NET application server
and DB server if they are separate machines; greater network scalability
3. Limited indexing for searching purposes versus externalized files
with external file indexing / searching tools
4. No capability to manually examine a file without programmatically
retrieving the file from the database first - can be an inconvenience
when it is necessary to do so, perhaps for support and maintenance or
debugging purposes
5. More database expertise required to effectively partition database to
support files versus simply storing on filesystem - perhaps could impact
performance of your database if not done well

Shan
 
Joined
Aug 14, 2009
Messages
1
Reaction score
0
Using the Visual Studio 2008 Design to add pictures to sql ce database

I am using visual studio 2008 to create a data source and I am adding the tables by using the design part - not actually writing out sql statements in visual studio. I am using C# to write the code for a mobile device app. When I add a column named Image of Image type or varbinary type - I do not know how to add the image to the database. Do I use the image file name or what do I use???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top