double days = Convert.ToDouble(txt_working.Text);
double sundays = Convert.ToDouble(txt_netpay.Text);
double a = Convert.ToDouble(txt_basicscale.Text);
txt_basicamount.Text = Convert.ToDouble((a / days) * sundays).ToString();
when i try this above code i got error as
in second line input sting was not in a correct format.
please help me
Loading
VulpesPosted Jul 10, 2012, 5:28 AM
Praveen KumarPosted Jul 10, 2012, 5:21 AM
You don't have to open a new thread for code from previous thread. If you have problem in solutions provided by some user then reply in the same thread.
Also you don't have to post the same question multiple times.
Satyapriya NayakPosted Jul 10, 2012, 5:12 AM
Why repeatedly you are doing the same mistake by creating new thread rather discussing with the same thread itself.
http://www.c-sharpcorner.com/Forums/Thread/178649/salary-amount-to-be-calculated.aspx
I think your questions you are posting are not clear enough for the members to give suitable answers. So please sure that when you are posting any question elaborate it deep and clearly.Thanks
WH XuPosted Jul 10, 2012, 4:57 AM
VulpesPosted Jul 10, 2012, 4:46 AM
The most likely reason is that the textbox is empty.
You therefore need to check for this or use the double.TryParse() method rather than Convert.ToDouble.
The same applies to the other two textboxes as well.