Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows Application
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 27-Dec-11 3:59am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
thatraja at 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 at 30-Dec-11 9:33am
   
5'ed!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
Comments
thatraja at 27-Dec-11 12:03pm
   
5!
Mika Wendelius at 27-Dec-11 13:39pm
   
Thanks :)
Espen Harlinn at 30-Dec-11 9:34am
   
5'ed!
Mika Wendelius at 30-Dec-11 10:23am
   
Thanks :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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[^]
  Permalink  
Comments
Uday P.Singh at 27-Dec-11 11:39am
   
Agree 5+
Mika Wendelius at 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 at 28-Dec-11 21:10pm
   
Ofcourse, We need permission for those files on webserver. Also the relationship between the records & images
Mika Wendelius at 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 at 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)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 27 Dec 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100