title: How to convert string to int32 c#?
body: <p>I'm trying to do an insertion to a Transaction table in SQL Server from a certain textboxes and one label on C# Windows Form, with the following code:</p>
  
  <pre><code>AppProcess abc = new AppProcess();
  SqlConnection sqlconn1 = abc.GetConn();
  
  SqlCommand sqlinsert = new SqlCommand("insert into Payment values
  (@TID,@EID,@CustID,@CFName,@CLName,@BID,@BName,@Price,@Qty,@TransDate)",
  sqlconn1);
  
  DataTable dtCustomer = new DataTable();
  sqlconn1.Open();
  
  sqlinsert.Parameters.Add(new SqlParameter("@TID", SqlDbType.VarChar, 10));
  sqlinsert.Parameters.Add(new SqlParameter("@EID", SqlDbType.VarChar, 10));
  sqlinsert.Parameters.Add(new SqlParameter("@CustID", SqlDbType.VarChar, 10));
  sqlinsert.Parameters.Add(new SqlParameter("@CFName", SqlDbType.VarChar, 100));
  sqlinsert.Parameters.Add(new SqlParameter("@CLName", SqlDbType.VarChar, 100));
  sqlinsert.Parameters.Add(new SqlParameter("@BID", SqlDbType.VarChar, 10));
  sqlinsert.Parameters.Add(new SqlParameter("@BName", SqlDbType.VarChar, 100));
  sqlinsert.Parameters.Add(new SqlParameter("@Price", SqlDbType.Int));
  sqlinsert.Parameters.Add(new SqlParameter("@Qty", SqlDbType.Int));
  sqlinsert.Parameters.Add(new SqlParameter("@Transdate", SqlDbType.Date));
  
  sqlinsert.Parameters["@TID"].Value = tidTxt.Text;
  sqlinsert.Parameters["@EID"].Value = eidTxt.Text;
  sqlinsert.Parameters["@CustID"].Value = cidTxt.Text;
  sqlinsert.Parameters["@CFName"].Value = cfnameTxt.Text;
  sqlinsert.Parameters["@CLName"].Value = clnameTxt.Text;
  sqlinsert.Parameters["@BID"].Value = bidTxt.Text;
  sqlinsert.Parameters["@BName"].Value = bnameTxt.Text;
  sqlinsert.Parameters["@Price"].Value = label17.Text;
  sqlinsert.Parameters["@Qty"].Value = qtychoiceTxt.Text;
  sqlinsert.Parameters["@Transdate"].Value = TransDateTxt.Text;
  
  sqlinsert.ExecuteNonQuery();
  </code></pre>
  
  <p>But when I run the app, it generates this error:
  <a href="https://i.stack.imgur.com/DwQVX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DwQVX.png" alt="click here to see what the error looks like"></a></p>
  
  <p>I'm confused which line triggers the error though. And how to convert the string to Int32?</p>