title: Save button code connecting to database not working in ASP.NET
body: <p>I am trying to submit filledin information in the form to the database. I have done the below mentioned coding for the save button. When I click on the save button to save the information, I am getting an error. I need it to be done and for the same need help from the geeks around here.</p>
  
  <p>COde for SAVE button data from database </p>
  
  <pre><code>public partial class _Default : System.Web.UI.Page 
  {
      protected void Page_Load(object sender, EventArgs e)
      {
  
          string conn = ConfigurationManager
                         .ConnectionString("welcome").ConnectionString;
          SqlConnection con=new SqlConnection(conn);
          SqlCommand cmd = new SqlCommand("Insert into abhishek(pr_name,Add,add2) values(@ah,@Ap,@qe)",con);
  
          cmd.CommandType = CommandType.Text;
  
          cmd.Parameter.Addwithvalue("@ah", TextBox1.Text.Trim());
          cmd.Parameter.Addwithvalue("@ap", TextBox2.Text.Trim());
          cmd.Parameter.Addwithvalue("@qe", TextBox3.Text.Trim());
          con.Open();
          cmd.ExecuteNonQuery();
          con.Close();
      }
  }
  </code></pre>
  
  <p>Check the error in the image below:</p>
  
  <p><img src="https://i.stack.imgur.com/Zj4de.png" alt="enter image description here"></p>