title: How to insert image to database in Asp.net?
body: <p>With the below code i am able to insert datas to database.I have a tabel called class with 4 fields calssid, classname, description and img. classid is primary key and autoincrement so need nothing to do for it.As in the code below i have inserted classname and description but left img filed emplty.
  <br>
  So how do I insert image?</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      string str = @"Data Source=SUMAN-PC\SQLEXPRESS;Initial Catalog=school;Integrated Security=True";
      SqlConnection con = new SqlConnection(str);
      SqlCommand cmd = new SqlCommand(" select * from class", con);
      SqlCommand insert = new SqlCommand("insert into class values('class10','i am from class 10','')",con);
      con.Open();
      insert.ExecuteNonQuery();
   }
  </code></pre>
  
  <p>Please note that what i am asking is if i can upload image directly from here just like i uploaded other fields by providing link to image stored in some folder of my project.
  <br>
  I am not seeking to store image in database by uploading image.</p>