I'm having trouble pinpointing the cause of an inconsistent error I'm getting in an application connecting to our Oracle database after updating from ODAC 9i to 11.2. When the application tries to open the oracle connection, I get the following error:
message: ""
error code: -2147467259
stack trace:
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open() . . .
However, the connection is successful through other applications such as PL/SQL, sqlplus, and even a new .Net test form I wrote to double check the install. After searching this error, I have already tried double checking TNSNames.ora (which is correct), ensuring that there is only one copy oracle installed on the machine, and the firewall on the machine running the application. I'd appreciate any help you could offer to point me in the right direction.
My current setup:
* Windows 7 64 bit
* VS 2010 with .Net 4
* ODAC 11.2 Release 5 (11.2.0.3.20)
* The application is 32 bit
* Database server is on 10g (I've also tried unsuccessfully with a test version on 11g)
The code that opens the connection is:
using Oracle.DataAccess.Client;
public partial class MyClass
{
OracleConnection _dbConnection;
String _dbUserName;
String _dbPassword;
String _dbSourceString;
public void OpenConnection()
{
String connectionString = "User Id=" + dbUserName + ";Password=" + dbPassword + ";Data Source=" + _dbSourceString + ";";
_dbConnection = new OracleConnection(connectionString);
try
{
_dbConnection.Open();
}
catch (OracleException e)
{
MessageBox.Show("Connection String: \n" + _dbConnection.ConnectionString + "\n\nError Message: " + e.Message,
"Database Connection Failure", MessageBoxButtons.OK);
}
}
}