Can't connect to Oracle database
I am working on an ASP.NET project, which uses C# for code-behind. It attempts to connect to an Oracle开发者_开发技巧 database using the following code, which already existed in the project when I began working on it:
OracleConnection myConnection = new OracleConnection();
myConnection.ConnectionString = ConfigurationManager.ConnectionStrings["OraFinCnString"].ConnectionString;
myConnection.Open();
The application runs locally (opens up in a browser on localhost
), and attempts to connect to a remote Oracle Database. When I run it, the The last line above gives the following error:
"InvalidOperationException was unhandled by user code. Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."
The connection string was provided by my client, so I presume it is correct, and this doesn't seem like the sort of error that would be caused by incorrect connection information. But I'm pretty well stumped as to exactly what the problem is, and would appreciate any insight.
Please take a look at the following link. You will need to Install Oracle 11g Oracle Data Access Components
Oracle Provider
精彩评论