title: Arithmetic overflow error converting varchar to data type numeric in asp.net
body: <p>I am trying to insert a record that has decimal place, example: 7654.00 and the data type for this column is <code>numeric(10,12)</code> but I am getting arithmetic overflow error and I know I need to do a conversion first but not sure how.. </p>
  
  <p>The column I have the issue with is <code>TotalCost</code>.</p>
  
  <p>Here is what I have:</p>
  
  <pre><code>string FullName = row.Cells[1].Text;
  string TotalCost = row.Cells[6].ToString(); 
  
  using (SqlConnection myCon = new SqlConnection(myConnStr))
  {
      using (SqlCommand myCmd = new SqlCommand())
      {
           myCmd.Connection = myCon;
           myCmd.CommandType = CommandType.Text;
           myCmd.CommandText = @"insert into myTable (FullName, TotalCost) 
                                 values(@FullName, @TotalCost)";
           myCmd.Parameters.AddWithValue("@FullName", FullName.ToString());
  
           myCmd.Parameters.AddWithValue("@TotalCost", TotalCost)
  
           myCon.Open();
           myCmd.ExecuteNonQuery();
           myCon.Close();
       }
  }
  </code></pre>