help.net


Musing on .Net

News





hit counters




Open source CMS


Technorati

My blog

Irish blogs

Locations of visitors to this page Get Chitika eMiniMalls

.Net useful

Blogs I read

PocketPC

SQL

Usability

Storing Images to Database and Retrieving to GridView

Over the internet, one can easily find a lot of references for uploading images to a database. The major problem arises when one has to retrieve these images and display them in some server control, like the GridView control.

Nice article, read more...

 

Posted: Sep 19 2006, 10:22 AM by help.net | with 4 comment(s)
Filed under:

Comments

vikram said:

Hi I would advise you not to store images in the database but to store them in some folder and the url of the folder in the database. Hence you can retrieve the URL of the image at the runtime and bind it to the correct control

# September 19, 2006 7:36 AM

Paschal said:

Vikram I disagree, both solutions are valid, the thing is to know what you want to do. I am building a kind of Flickr tool for my company, and having the images stored in the database works quite well. It's much easier to manage and like any piece of content, I can build a management tool for any Crud functions.
# September 19, 2006 7:43 AM

Phil John said:

I've got to agree with Vikram here, when you do a select, having the images in the database causes much more traffic between the database and your app, more memory usage than is necessary and will overall reduce performence for little tangible benefit. If you were storing office documents in the DB there is more of a case for it, as MSSQL Server FullText search can index the contents of the file. Also, as regards to the linked page, I wouldn't trust it too much as the code is vulnerable to an SQL Injection attack and the Image Output file should have been an ASHX file as it doesn't need the overhead of a full ASPX file.
# September 19, 2006 1:58 PM