On 8/3/09, santhosh vs <[email protected]> wrote:
> What he gave is
> "three"
> and asked to convert , lol
>
>
> On Sat, Aug 1, 2009 at 11:50 PM, san <[email protected]> wrote:
>
> >
> >
> >
> >
> >
> > if temp"contains "Characters" then how it will convert it into number's .
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Sat, Aug 1, 2009 at 7:30 AM, 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).
> > >
> >
> >
>
>
>
> --
>
> Santhosh V
> http://techplex.wordpress.com
>
>
Just Use
private void button1_MouseClick(object sender, MouseEventArgs e)
{
double temp2;
temp2 = Convert.ToInt64( textBox1.Text);
}