在Oracle中找不到请求的.Net Framework数据提供程序 [英] Unable to find the requested .Net Framework Data Provider in Oracle

查看:622
本文介绍了在Oracle中找不到请求的.Net Framework数据提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

string constr =数据源=(DESCRIPTION =(地址=(PROTOCOL = tcp)(HOST = spp01)(PORT = 1521))(CONNECT_DATA =(SID = Global))));用户

string constr = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=spp01)(PORT=1521))(CONNECT_DATA=(SID=Global)));User

Id = SYSMAN; Password = testman3; 字符串ProviderName ="Oracle.DataAccess.Client";

Id=SYSMAN;Password=testman3"; string ProviderName = "Oracle.DataAccess.Client";

        DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);

我能够在控制台和Winforms应用程序中连接到oracle.上面的代码在单独的类库中.我已经安装了64位ODAC.

I am able to connect to oracle in console and winforms application. The code above is in a seperate class library. I have installed 64bit ODAC.

ORACLE.DATAACCESS设置为2.x ver 2.112.3.0.我已经检查了machine.config条目Framework64 v2.0.50727和v4.0.30319

The ORACLE.DATAACCESS is set to 2.x ver 2.112.3.0. I have checked machine.config entries Framework64 v2.0.50727 and v4.0.30319

type ="Oracle.DataAccess.Client.OracleClientFactory,Oracle.DataAccess,Version = 2.112.3.0,Culture = neutral,PublicKeyToken = 89b483f429c47342"/>

type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

CPU =任何CPU框架= 3.5

CPU = Any CPU Framework=3.5

当我从ASP.net的类库中调用相同的代码时,会出现以下错误

When I call the same code from class library in ASP.net then I get the following error

用户代码未处理System.ArgumentException Message =无法找到请求的.Net Framework数据提供程序.它可能没有安装. 源= System.Data 堆栈跟踪: 在System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)

System.ArgumentException was unhandled by user code Message=Unable to find the requested .Net Framework Data Provider. It may not be installed. Source=System.Data StackTrace: at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)

我甚至将apppool设置为允许32位应用程序.

I have even set the apppool to allow 32-bit applications.

如何解决此错误?

推荐答案

该错误表明您的系统上未安装Oracle客户端.要验证它,您可以运行下面的代码行:

The error shows that the Oracle client is not installed on your system. To validate it you can run the line of code below:

System.Data.Common.DbProviderFactories.GetFactoryClasses()

您将获得所有已安装数据提供程序的数据表.如果DataTable中未列出Oracle.DataAccess.Client不变量,则表明它未安装.

You will get a DataTable of all the installed data providers. If Oracle.DataAccess.Client invarient is not listed in the DataTable then it means it is not installed.

我在一台客户端计算机上也遇到了同样的问题,在调试时,我发现Oracle客户端是从Admin用户安装的,他们正试图从其他用户访问它.

I was also facing the same issue on one of our clients machine and on debugging i found that the Oracle client was installed from the Admin user and they were trying to access it from some other user.

从当前用户安装Oracle客户端即可解决此问题.

请不要忘记在安装Oracle客户端后重新启动应用程序.

Please don't forget to restart your application after installing the Oracle client.

这篇关于在Oracle中找不到请求的.Net Framework数据提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆