Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello,
i am developing windows application supporting several users on LAN. among the data to be stored and retrieved is pictures, so:
should i store them inside database (SQL server), or only to store their path inside database and store images on HD?

also what image format should i choose (JPEG, PNG, etc)?




Thanks Alot
Samer
Posted

I vote that you store them in the database. If you don't need transparency, I would use JPG because they can compress to a MUCH smaller size.
 
Share this answer
 
Comments
thatraja 27-Dec-11 12:03pm    
If you don't need transparency, I would use JPG because they can compress to a MUCH smaller size
Agree, 5!
Espen Harlinn 30-Dec-11 9:33am    
5'ed!
As a personal opinion, I would put them inside the database. Propably using Filestream to more easily handle backups and transactions (if interested, see: How to store and fetch binary data into a file stream column[^]).

JPG as the image format sounds tempting because of the size as JSOP pointed out.
 
Share this answer
 
Comments
thatraja 27-Dec-11 12:03pm    
5!
Wendelius 27-Dec-11 13:39pm    
Thanks :)
Espen Harlinn 30-Dec-11 9:34am    
5'ed!
Wendelius 30-Dec-11 10:23am    
Thanks :)
I prefer File system. Check this link for more details. And yes the below link is about web application but you just need minor changes to use that in win application(Loading pictures into Picturebox).
Storing Uploaded Files in a Database or in the File System with ASP.NET[^]
 
Share this answer
 
Comments
Uday P.Singh 27-Dec-11 11:39am    
Agree 5+
Wendelius 28-Dec-11 15:00pm    
This was an interesting link to read, my 5.

The disadvantages with the database were mainly speed and easy access. Do you feel that these are still correct even if Filestream is used?
thatraja 28-Dec-11 21:10pm    
Ofcourse, We need permission for those files on webserver. Also the relationship between the records & images
Wendelius 29-Dec-11 0:42am    
Yes, the permissions must be given but the relationship with the record is 'automatically' created since the image (in this case) is stored to the database but actually placed separately on the filesystem by SQL Server engine.

I'll have to think about this :)
Espen Harlinn 30-Dec-11 9:34am    
5'ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900