oracle Web.config 中的 ODP.NET 配置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/508252/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 17:45:18  来源:igfitidea点击:

ODP.NET Configuration in Web.config

.netoracleodp.net

提问by Guille

I'm adding the odp configuration in the application web.config file. For this I have a configuration section named "oracle.dataaccess.client". Therefore I'm adding an entry in the <configSections>section. Something like this:

我正在应用程序 web.config 文件中添加 odp 配置。为此,我有一个名为“oracle.dataaccess.client”的配置部分。因此,我在该<configSections>部分添加了一个条目。像这样的东西:

<section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

I'm not sure about the type parameter. My question is, what value must i use for the type parameter? Where can I find it? The Oracle client is 9.2. The .net framework is 1.1

我不确定类型参数。我的问题是,我必须为类型参数使用什么值?我在哪里可以找到它?Oracle 客户端是 9.2。.net 框架是 1.1

采纳答案by Guulh

ODP 9.2 was released before .Net 2, and does not implement the new interfaces and factories this framework added (in the System.Data.Common namespace)

ODP 9.2 在 .Net 2 之前发布,并没有实现这个框架添加的新接口和工厂(在 System.Data.Common 命名空间中)

In other words, you cannot configure this version of ODP via the System.Data.Common configuration entries. ADO.net 2.0 compatibility started with version 10.2.0.2 of ODP (see http://www.oracle.com/technology/oramag/oracle/06-winsupp/win06odp.htmlfor instance)

换句话说,您无法通过 System.Data.Common 配置条目配置此版本的 ODP。ADO.net 2.0 兼容性从 ODP 10.2.0.2 版本开始(例如,请参见http://www.oracle.com/technology/oramag/oracle/06-winsupp/win06odp.html

回答by Igor Zelaya

check also the Oracle? Data Provider for .NET Developer's Guide

检查还Oracle?.NET 开发人员指南的数据提供程序

Edit:

编辑:

OK, so I guess this is what you are looking for:

好的,所以我想这就是您要查找的内容:

Add under <configuration> <configsections>the following entries to web.config:

<configuration> <configsections>web.config 中添加以下条目:

<section name="oracle.dataaccess.client" 
type="System.Data.Common.DbProviderConfigurationHandler, System.Data, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

Add under <system.data> <DbProviderFactories>the following entry

<system.data> <DbProviderFactories>以下条目下添加

<add name="Oracle Data Provider for .NET" 
invariant="Oracle.DataAccess.Client" description="Oracle Data Provider 
for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, 
Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, 
PublicKeyToken=89b483f429c47342" />