i have a ptoblem here
Input string was not in a correct format.
and i can't solve it
c# code :-
public decimal totalsalary()
{
decimal ms, h, b, m, k, t;
ms = Convert.ToDecimal(txtmainsalary.Text);
h = Convert.ToDecimal(txthwaf.Text);
b = Convert.ToDecimal(txtbdlat.Text);
m = Convert.ToDecimal(txtmok.Text);
k = Convert.ToDecimal(txtkhasm.Text);
t = ms + h + b + m - k;
return t;
}
public int totsa(decimal total)
{
con.Open();
com.Connection = con;
com.CommandText = "totsal";
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@totalsalary", total);
ESalary es = new ESalary();
int r = com.ExecuteNonQuery();
con.Close();
return r;
}
private void button1_Click(object sender, EventArgs e)
{
empsearchclass esc = new empsearchclass();
esc.addesalary((int)comboBox1.SelectedValue, Convert.ToDecimal(txtmainsalary.Text), Convert.ToDecimal(txthwaf.Text), Convert.ToDecimal(txtbdlat.Text), Convert.ToDecimal(txtmok.Text), Convert.ToDecimal(txtkhasm.Text));
totalsalary();
esc.totsa(Convert.ToDecimal(txttotal.Text));
}
the error here
esc.totsa(Convert.ToDecimal(txttotal.Text));