Hi
Whenever you are getting a value from Textbox Please note these thing,
Trim
the value of Text box, because the user might have entered space by mistake,
space
is also a character which will result in wrong data.
So always
Trim
the values ..
If you want to cast a data from text box to Int or Double , instead of
Convert.ToDouble
or
Double.Parse
, you can use
TryParse
for Safe conversion.
Below is my code... If it is useful you can use this..
double a1, b1, c1, d1, e1;
double.TryParse(txtRawMm.Text.Trim(), out a1);
double.TryParse(txtCsp.Text.Trim(), out b1);
double.TryParse(txtPf.Text.Trim(), out c1);
double.TryParse(txtSe.Text.Trim(), out d1);
double.TryParse(txtIowc.Text.Trim(), out e1);