Abdalla Elawad

Abdalla Elawad

  • NA
  • 1k
  • 214.5k

How to Convert Numeric to data type varchar

Aug 17 2016 6:33 AM
 I have field in sql tbl as numeric data type (numeric(18,0) but in c# code when i save data
display this message "
Arithmetic overflow error converting numeric to data type varchar.The statement has been terminated."
 
As follow code c#
 
SqlCommand cmd = new SqlCommand("CashPlan_Insert", Conn);
cmd.Parameters.Add("@CarNo", SqlDbType.VarChar).Value = (DropDownList1.SelectedValue);
cmd.CommandType = CommandType.StoredProcedure;
Conn.Open();
cmd.ExecuteNonQuery();
Conn.Close();
 

Answers (12)