Oracle.DataAccess Error

I have an asp.net/C# web application running on a Windows environment. The project builds perfectly and works great on the local VB.net development server.

However, when I publish on a real application server, I get the following error message:

[OracleException (0x80004005): the provider is incompatible with the Oracle client version] [TypeInitializationException: the type initializer for "Oracle.DataAccess.Client.OracleConnection" made an exception.]

Currently, the version of this application is working and working fine, I'm testing on a real server in a different directory. I even tried snatching Oracle.DataAccess.dll from a working application, but still getting the same error message.

+4
source share
5 answers

First of all: the Oracle client / provider is a mess. And this goes for both MS and Oracle.

To connect to an Oracle database through an ODP.NET provider, three things must be set up correctly:

  • The Oracle client must be configured correctly (has nothing to do with the .NET provider, this refers to the installed oracle client, usually in c: \ oracle)
  • ODP.NET provider must be compatible with the installed Oracle client
  • The client and provider architecture and your application must match, you cannot use a 64-bit client with an x86 provider / application and vice versa.

It is usually best to have the latest version. But if you want to get rid of this problem once and for all, use the third-party .NET provider Oracle.

UPDATE

- DataDirect ( ):
http://www.datadirect.com/products/net/net-for-oracle/index.html

( -), , , x64 , , ODP.NET. .

DevArt ( ):
http://www.devart.com/dotconnect/oracle/

DataDirect , .

, .NET, :
http://msdn.microsoft.com/en-us/data/dd363565

+12

ODAC Oracle .NET

ODAC- oracle

4.xx

,

, :)

+1

, Oracle.DataAccess.dll prod. , / Oracle.DataAccess.dll , DLL prod- oracle . .dll " = " " " = true. , , oracle dev- prod.

+1
Equals, with Oracle.DataAccess.dll    Works!!!!
//using Oracle.DataAccess.Client

object pdf = null;

var queryString =@"SELECT PDF  FROM DIGITAL  WHERE ID_DIGITAL=1001" ;  //example
var ctx = new Entities();
var entityConn = ctx.Connection as EntityConnection;

if (entityConn != null)
{
var dbConn = entityConn.StoreConnection as OracleConnection;
dbConn.Open();

var cmd = new OracleCommand(queryString, dbConn);
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
pdf = reader[0];
}
}
dbConn.Close();
}
return pdf;
+1

Visual Studio .

I spent a lot of time talking with the GAC and various versions of Oracle.DataAccess.dll, and ended up just starting VS, since the administrator started it to start.

0
source

All Articles