473,386 Members | 1,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Convert.Int32("0")causes{"Input string was not in a correct format

Convert.Int32 fails for "0" but works fine for all other numbers.

This does not work on one machine when "0" it works fine on other machines
Convert.ToInt32(“0”);
gives exception {"Input string was not in a correct format."}

If I specify base 10 this works on all machines
Convert.ToInt32(“0”,10);

So I have 3 related questions.
1. Why is it only happen when I am converting a "0".
2. Why does it work when I declare base 10
3. Why is this problem only occuring on 1 machine.

Somethings I have tried.
1. Compiled the code on another machine. The compiled code runs fine on the
other machines. I would think this eliminates coding/compiler issues.
2. Repaired .NET 2.0 framework
3. Reinstalled .NET 2.0 framework
4. Moved same code & binaries to other machines and had no problems.

Is there some machine/system or framework setting that could cause this
problem.

Any ideas would be greatly appreciated.

Feb 23 '06 #1
1 4905

Are you sure you typed zero and not the letter O?

James Pose wrote:
Convert.Int32 fails for "0" but works fine for all other numbers.

This does not work on one machine when "0" it works fine on other
machines Convert.ToInt32(“0”);
gives exception {"Input string was not in a correct format."}

If I specify base 10 this works on all machines
Convert.ToInt32(“0”,10);

So I have 3 related questions.
1. Why is it only happen when I am converting a "0".
2. Why does it work when I declare base 10
3. Why is this problem only occuring on 1 machine.

Somethings I have tried.
1. Compiled the code on another machine. The compiled code runs fine on
the other machines. I would think this eliminates coding/compiler issues.
2. Repaired .NET 2.0 framework
3. Reinstalled .NET 2.0 framework
4. Moved same code & binaries to other machines and had no problems.

Is there some machine/system or framework setting that could cause this
problem.

Any ideas would be greatly appreciated.


Feb 23 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Wally | last post by:
I am trying to display images from an Access 2000 database and I get an error "Invalid Parameter Used" when I execute the code line "picBLOB.Image = Image.FromStream(stmBLOBData)" in my Visual...
6
by: DraguVaso | last post by:
Hi, In my application, on some given actions while debugging in Visual Studio, I suddenly get a "System.ComponentModel.Win32Exception was unhandled" Message="Error creating window handle."...
188
by: infobahn | last post by:
printf("%p\n", (void *)0); /* UB, or not? Please explain your answer. */
0
by: dbuchanan | last post by:
Hello, Why am I getting this error? I don't know how to isolate it. It occurs intermittently. Has anyone seen this before? Here is the full text \\ System.IO.FileLoadException was...
8
by: Pieter | last post by:
Hi, I'm having some weird problem using the BackGroundWorker in an Outlook (2003) Add-In, with VB.NET 2005: I'm using the BackGroundWorker to get the info of some mailitems, and after each item...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
10
by: Dave griffiths | last post by:
Hi all Using VB2005 on Vista with a Norwegian locale setup. The test program has 3 textboxes the sum held in txt3. Using the code below, txt2 conversion causes an error when it is left empty....
0
by: Harshpandya | last post by:
Hi I am using MYSQL and ASP.Net. to build the Data Reader Page. when i define my connection Key - it gives me this error.Keyword not supported: 'dsn'. MY PAGE Data Reader <%@ Page Language="C#"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.