narasiman man

narasiman man

  • NA
  • 0
  • 118.2k

I am having three text boxes as below

Jun 18 2012 5:54 AM
 i am having three text boxes as below

   Rent           textbox

   service tax   textbox

   Gross rent    textbox


i am adding rent and serice tax output will be displayed in gross rent.

i write caluation code in txt_tax as below

private void txt_tax_TextChanged(object sender, EventArgs e)
        {
            int a, b, c;
            a = Convert.ToInt32(txt_rent.Text);
            b = Convert.ToInt32(txt_tax.Text);
            c = a + b;
            txt_grossrent.Text = c.ToString();
        }


for example i type service tax amount as 1000 then i clear the 1000 amount

the error occurs as   Input string was not in a correct format.

please help me.please give the correct code.

Regards 

Narsiman



Answers (2)