Bizarre OracleClient behavior

  • Thread starter Thread starter brian lanning
  • Start date Start date
B

brian lanning

Hello. I'm having strange problems with System.Data.OracleClient.
This is the managed oracle data provider in the 1.1 framework. We've
used this assembly on a number of projects and have had no problems.

The latest project is an extremely simple asp.net project. Here's the
code:

try {
string source = "User ID=cbk;Password=blabla;Data Source=cbk;";
OracleConnection mConn = new OracleConnection();
mConn.ConnectionString = source;
mConn.Open();
}
catch(Exception e)
{
log("there was an oracle error: " + e.ToString());
}

Couldn't be easier right? At either the open, or when setting the
connect string, I get this error:

An unhandled exception of type "System.ArgumentOutOfRangeException"
occurred in Unknown Module. Additional Information: Length cannot be
less than zero.

This code is in a try/catch block and the catch does not catch it!
Breaking tells you nothing because there's no source. It doesn't seem
to matter which constructor I use. I can pass in the connect string
any way and get the same behavior. This code works on other machines.
If I compile it on my machine and install it elsewhere, it works. On
my machine, this code works in other projects. I've rebuilt the
project with no affect.

This is really looking to me like a bug in the assembly. Any ideas?

brian
 
Hello. I'm having strange problems with System.Data.OracleClient.
This is the managed oracle data provider in the 1.1 framework. We've
used this assembly on a number of projects and have had no problems.

The latest project is an extremely simple asp.net project. Here's the
code:

try {
string source = "User ID=cbk;Password=blabla;Data Source=cbk;";
OracleConnection mConn = new OracleConnection();
mConn.ConnectionString = source;
mConn.Open();
}
catch(Exception e)
{
log("there was an oracle error: " + e.ToString());
}

Couldn't be easier right? At either the open, or when setting the
connect string, I get this error:

An unhandled exception of type "System.ArgumentOutOfRangeException"
occurred in Unknown Module. Additional Information: Length cannot be
less than zero.

This code is in a try/catch block and the catch does not catch it!
Breaking tells you nothing because there's no source. It doesn't seem
to matter which constructor I use. I can pass in the connect string
any way and get the same behavior. This code works on other machines.
If I compile it on my machine and install it elsewhere, it works. On
my machine, this code works in other projects. I've rebuilt the
project with no affect.

This is really looking to me like a bug in the assembly. Any ideas?

brian
Does Oracle work on this machine (sql plus can connect). If it's an
asp app then does the aspnet user have rights to the oracle/bin
directory.
 
This code works on other projects on this machine. Sqlplus works fine
also. I had previously been using the 9.2 oracle client so I set up a
virtual directory for that directory. When the other machine worked,
I noticed that it has the 8.1 client. So I uninstalled 9.2 and
installed 8.1. I forgot to change the virutal directory until you
mentioned it. None of this had any affect. Even with the wrong
virtual directory, I got the same error. This code in this project
used to work.

brian
 
Back
Top