double days = Convert.ToDouble(txt_working.Text);
double sundays = Convert.ToDouble(txt_days.Text);
double a = Convert.ToDouble(txt_basicscale.Text);
txt_basicamount.Text = Convert.ToDouble((a / days) * sundays).ToString();
the above code is working but when i press clear button error occurs in first line
input string was not in a correct format.
clear button code as follows
txt_wroking.text="";
txt_days.text="";
txt_basicscale.text="";
txt_basicamount.text="";
i dont know.please tell the correct thats why i am asking.
Loading
VulpesPosted Jul 10, 2012, 6:25 AM
I'm beginning to think you must be someone who's having a laugh with us all here!
We've already told you the answer to this one in your other thread. A blank textbox can't be converted to a double so you need to either check specifically for this or use double.TryParse instead:
http://www.c-sharpcorner.com/forums/thread/178657/getting-error-when-i-try-this-code.aspx