Sunday, March 15, 2009

Saving Images in a SQL database using ASP.Net

The ability to display images in a web application is a common requirement. There are two ways you can do this, either store images in a SQL database using the Binary Large Object (commonly know as BLOB) data type, or store the image on the disk. There are pro’s and cons to each of these methods, but in this article we’re going to learn how to store images into a SQL database.
For the purpose of this article I have created a table in SQL Server called Images, with three columns, Image Name, Image Type and the Image itself. Now let’s take a look at the form we are going to use, to upload images to this table.

No comments:

Post a Comment