Tuesday, July 26, 2016

.NET Oracle Client

Method 1: Web.config
<configuration>
  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"/>
    <section name="oracle.dataaccess.client" type="System.Data.Common.DbProviderConfigurationHandler, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
  </configSections>
  <dataConfiguration defaultDatabase="DefaultDatabase">
    <providerMappings>
      <add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.DDTekOracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="DDTek.Oracle"/>
      <add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Oracle.DataAccess.Client" />
    </providerMappings>
  </dataConfiguration>
  <connectionStrings>
    <add name="ConnectionString1" providerName="Oracle.DataAccess.Client" connectionString="User Id=;Password=;Data Source=; Pooling=true; Min Pool Size=1; Max Pool Size=50; Incr Pool Size=10; Decr Pool Size=10; Connection Timeout=50; Validate Connection=true;"/>
  </connectionStrings>
</configuration>

Method 2: Web.config
<connectionStrings>
    <add name="ConnectionString1" providerName="Oracle.ManagedDataAccess.Client" connectionString="User Id=;Password=;Data Source=; Pooling=true; Min Pool Size=1; Max Pool Size=50; Incr Pool Size=10; Decr Pool Size=10; Connection Timeout=50; Validate Connection=true;"/>
  </connectionStrings>
<system.data>
    <DbProviderFactories>
      <remove invariant="Oracle.ManagedDataAccess.Client" />
      <remove invariant="Oracle.DataAccess.Client" />
      <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=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
      <add name="ODP.NET, Managed Driver"
           invariant="Oracle.ManagedDataAccess.Client"
           description="Oracle Data Provider for .NET, Managed Driver"
           type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>

Method 3: Machine.config
<system.data>
    <DbProviderFactories>
    <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>   
</system.data>

No comments: