Saurabh  Pandey

Saurabh Pandey

  • NA
  • 3
  • 4.7k

Sum Of textboxes values

Apr 10 2013 7:40 AM
this is my code
 int sum = int.Parse(TextBox5.Text) + int.Parse(TextBox6.Text) + int.Parse(TextBox7.Text);
            Label1.Text = String.Format("{0}", sum);

when I enter all three textboxes it runs clearly but if i keep any one or two of them null it gives error...
input was not in correct formate ..
how can I solve this error.....

Answers (5)