Click here to Skip to main content
15,899,475 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hello everybody !!
I want to know full concept of storing images in database using three tier in sql 2008 .. I want to know how to save the images in database in three tier or n tier... what is the full concept of storing the images and what methods are used to convert.. also why we use file stream and memory stream thank a lot , may God bless you with more knowledge and proficiency

What I have tried:

I tried to connect the image by using byte[] image type and reference this direct to database but giving error I don't know how to send the image please help
Posted
Updated 8-Mar-17 2:54am
Comments
Karthik_Mahalingam 8-Mar-17 2:35am    
dont store the image in sql table it will eat the db memory & performance, instead save the file in disk and store the path in table.
F-ES Sitecore 8-Mar-17 4:27am    
So don't store the image in the database as it will increase the size of the database, but store it on the file system instead? How are they any different? :) Instead of growing the DB by 1MB you're create a new file of 1MB, the net result is the same. If you store files in the file system then you complicate back-up strategies, need file naming conventions to prevent clashes, may need to manage a complex nested folder system etc so deciding if the file should be in the DB or on the file system needs to be decided on a case-by-case scenario, there is no blanket rule that is best for all.
Karthik_Mahalingam 8-Mar-17 4:32am    
what about the performance and cost ?
F-ES Sitecore 8-Mar-17 4:40am    
That's why you need to weigh it up on a case-by-case decision and decide what is of most importance to you. It might be better to spend your dev time coming up with something that caches frequently used images than coming up with something that keeps db and file system in synch, avoids filename clashes, people uploading images at the same time etc. Storing images on the file system can just move your costs elsewhere such as back-up strategies.
Karthik_Mahalingam 8-Mar-17 4:42am    
yes, strongly agree

Quote:
I have strongly asked for how to save images in database .. I only want to store images in db

check this, How to save ( insert ) Image in Database in ASP.Net using C# and VB.Net[^]


read the above comments regarding, file storage in db vs disk
 
Share this answer
 
It is just another form of data, nothing more. Same principles of your framework design. You can access it as a local filename & path; URL; byte array; stream; etc... and load it into the control at UI level.
 
Share this answer
 

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