ASP.NET Image to Database
A data type is an attribute that specifies the type of data that the object can hold. An Image is a Datatype in SQL Server that stores variable length binary data from 0 through 2A31-1 (2,147,483,647) bytes.
The following sql script help you to create a table with Image Datatype column.
CREATE TABLE [dbo].[imagestore]( [id] [int] NULL, [img] [image] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
The above script will create a table named as imagestore and define two columns , first column is id ,an integer datatype and second column is image, an image(img) datatype.
The following ASP.NET program upload an image file and saved it to local system and later that image will insert into the database.
Click the following links to see full source code