title: Convert TextBox to integer and store in Datatable
body: <blockquote>
    <p>I want to store Total Text Box value which is the sum of two field in datatable but it give me an error of incorrect format after storing the data</p>
  </blockquote>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
       nn.Open();
       SqlCeCommand cmd = new SqlCeCommand("INSERT INTO name (id,name,price,cost,total,Date) VALUES('" + idTextBox.Text + "', '" + nameTextBox.Text + "', '" + priceTextBox.Text + "', '" + costTextBox.Text + "','" + totalTextBox.Text + "', '" + dateDateTimePicker.Value.ToString("dd/MMMM/yy") + "' )", nn);
       cmd.ExecuteNonQuery();
       nn.Close();
  </code></pre>
  
  <p>// Total Text Box calculation</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)    
  totalTextBox.Text = (Convert.ToInt32(priceTextBox.Text) + Convert.ToInt32(costTextBox.Text)).ToString();
  </code></pre>