use image as a data type in sql
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.FileName != "")
{
byte[] img = new byte[FileUpload1.PostedFile.ContentLength];
HttpPostedFile Image = FileUpload1.PostedFile;
Image.InputStream.Read(img, 0, (int)FileUpload1.PostedFile.ContentLength);
string str = "insert img values(@img)";
SqlConnection cn = new SqlConnection("data source=localhost;initial catalog=aadarsh;user id=sa;password=cos123");
cn.Open();
SqlCommand cmd = new SqlCommand(str, cn);
cmd.Parameters.AddWithValue("@img", img);
SqlDataReader dr = cmd.ExecuteReader();
cn.Close();
}
}