title: What is wrong with my SQL Server query as it is not inserting the data in to table
body: <p>Here is my code</p>
  
  <pre><code>private void productsavebtn_Click(object sender, EventArgs e)
  {
      SqlConnection con = new SqlConnection("Data Source=SAJJAD-PC;Initial Catalog=hotel;Integrated Security=True;");
  
      try
      {
          con.Open();
          label1.Text = "Connection Successful";
  
          SqlCommand cmd1 = con.CreateCommand();
          cmd1.CommandText =( "INSERT INTO product (productname , productprice) VALUES ('" + productnametxtbox.Text + "','" + productpricetxtbox.Text + "')");
  
          try
          {
              cmd1.ExecuteNonQuery();
              label1.Text = "Data inserted successfully";
          }
          catch (Exception)
          {
              label1.Text = "Query execution failed";
          }
      }
      catch (Exception)
      {
          label1.Text = "Connection Failed";
      }
  }
  </code></pre>
  
  <p>Until connection open it works fine but after that it is not executing the query and it's not even showing any error.</p>