if your variable temp2 is long type, You must convet your string variable to a long type like this temp2=long(temp) On Jul 31, 10:00 pm, Rafael Anschau <[email protected]> wrote: > private void button1_MouseClick(object sender, MouseEventArgs e) > { > > string temp; > temp = textBox1.Text.ToString(); > double temp2; > temp2 = Convert.ToInt32(temp); > > } > > It compiles fine, but I get the runtime error "Format exception was > unhandled"" Input > string was not in a correct format" when the button is clicked. The > line it highlights is > temp2 = Convert.ToInt32(temp).
- [DotNetDevelopment] Re: What´s wrong w... Man Vuong Ha Thanh
- [DotNetDevelopment] Re: What´s wrong w... Rafael Anschau
- [DotNetDevelopment] Re: What´s wro... Processor Devil
- [DotNetDevelopment] Re: What´s... Rafael Anschau
- [DotNetDevelopment] Re: Wh... Cerebrus
- [DotNetDevelopment] R... Yashika
- [DotNetDevelopment] Re: What´s wrong with t... san
- [DotNetDevelopment] Re: What´s wrong w... santhosh vs
- [DotNetDevelopment] Re: What´s wro... Cybosoft Advertising Solutions
- [DotNetDevelopment] Re: What´s wrong w... Rafael Anschau
- [DotNetDevelopment] Re: What´s wrong with t... Marcelinho
- [DotNetDevelopment] Re: What´s wrong with t... Yashika
- [DotNetDevelopment] Re: What´s wrong with t... Sumit Nandi Roy
- [DotNetDevelopment] Re: What´s wrong w... Rafael Anschau
- [DotNetDevelopment] Re: What´s wro... Yashika
- [DotNetDevelopment] Re: What´s... santhosh
