narasiman rao

narasiman rao

  • NA
  • 519
  • 771.1k

how to check string i sempty or not

Jul 11 2012 1:31 AM

days   textbox1   calendarimage(when i clik the month that day will be in textbox1)

payable textbox2


wagesamount  textbox3  textbox4 when i type the wages amt in textbox3 that amt is divided by textbox1 and multipled by textbox2.i get the answer no problem.


but my problem when the textbox3 vlaue is empty the error messages shows input string was not in correct format.

my code  in textbox3 changed has follows


         double days = Convert.ToDouble(  textbox1.text );
            double payable = Convert.ToDouble( textbox2.text );
            double a = Convert.ToDouble( textbox3.text );
           textbox4.Text = Convert.ToDouble((a / days) *  payable  ).ToString();

how to avoid this error.from the below code how to change the code and get the answer correct.

please help me.urgent.







Answers (2)