Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help with Oracle Connection- "Input string was not in a correct format"

503004Mar 30 2006 — edited Apr 4 2006
Hello, can some one, anyone please help me. I have a simple VS 2005 C# application that connects to oracle. I've set it up to take the username, password and tnsname as arguments. I am using Client 9i, version 9.2.0.401 of Oracle.DataAccess.dll, and .NET Framework 2.0.

It works fine when I run it from VS 2005, I have also set up a test machine w/o VS 2005 and ran my install package and it runs fine. I sent it to one of my co-workers and when he tries it the OracleConnection obect fails with the error.

"Input string was not in a correct format"

strange in that it is not an ORA error, just the identifed text!?

Here is the code:
## begin code
OracleConnection dbc = new OracleConnection();
string sConnectString = "User Id=" + username.ToString() + ";Password=" + password.ToString() + ";Data Source=" + tnsname.ToString();
dbc.ConnectionString = sConnectString.ToString();
MessageBox.Show("Attempting to Connect to Oracle");
dbc.Open();
MessageBox.Show("Connected to Oracle: " + dbc.ServerVersion);

## end code

Pretty basic, what could be going on?

Since this only happens with an installation, I put in the message boxes to verify exactly where it chokes. I get the first message box, then an error with the identified text. I've seen a number of posts regarding input string format problems, but not a one dealing with OracleConnection.Open(). I added all the ToString() calls just to make sure everything was a string but it did not change the end result.

Anyone? Thanks In advance!

Eric S.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 2 2006
Added on Mar 30 2006
7 comments
5,287 views