System.Convert.ToInt64(String) method exception

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This statement (txtNewOdometer is a variable for an edit box):

lSN = System.Convert.ToInt64(txtNewOdometer.Text);

is causing an exception iff a zero ('0') is entered into the textbox. But
only on one user's computer; works fine on everyone elses.

The exception's Message is "Input string was not in a correct format."

Does anyone have any idea whatsoever on what could be happening, or what
further steps I can take to analyze this problem?

Any help greatly appreciated!
 
David Lowe said:
This statement (txtNewOdometer is a variable for an edit box):

lSN = System.Convert.ToInt64(txtNewOdometer.Text);

Use the TryParse method on Int64.

PS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top