Resolving "Unable to Find the Requested .NET Framework Data Provider" error when using Oracle.DataAccess unmanaged driver
Description
When exporting reports in Telerik Reporting, the error "Unable to find the requested .NET Framework Data Provider. It may not be installed" might occur.
This issue arises when using the Oracle unmanaged driver Oracle.DataAccess and the required data provider is not registered in the .NET Framework configuration.
Database access may still function because the Oracle client libraries are present, but Telerik Reporting will fail due to the missing provider registration.
Solution
-
Install the Oracle Data Access Components (ODAC):
- Download the appropriate ODAC package from the Oracle .NET Downloads.
- Choose the ODAC with Oracle Developer Tools for Visual Studio package matching your server architecture (64-bit for most IIS x64 app pools).
- Run the installer. This will:
- Install the Oracle Client and register the
Oracle.DataAccess.dllin the GAC. - Register the
Oracle.DataAccess.Clientprovider in the machine.config under<DbProviderFactories>. - Install the Oracle networking layer for TNS name resolution.
- Install the Oracle Client and register the
- Ensure the
tnsnames.orafile is reachable by placing it in the Oracle homenetwork/adminfolder or setting theTNS_ADMINenvironment variable to its location. - Recycle the IIS application pool after installation.
-
Manually Register the Data Provider (if installer cannot be used):
-
Add the following configuration to your application's
web.config:xml<configuration> <system.data> <DbProviderFactories> <remove invariant="Oracle.DataAccess.Client" /> <add name="ODP.NET, Unmanaged Driver" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET, Unmanaged Driver" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.122.21.1, Culture=neutral, PublicKeyToken=89b483f429c47342" /> </DbProviderFactories> </system.data> </configuration> -
Adjust the
Versionto match the exact version ofOracle.DataAccess.dllyou are deploying. -
Ensure the following:
Oracle.DataAccess.dlland its native dependencies (e.g.,oci.dll,oraociei*.dll) are accessible either in the GAC and Oracle home or in the application'sbinfolder.- An Oracle client is installed for TNS name resolution.
-
-
Configure the Connection String:
-
Update the connection string in the
web.configto use the TNS name and the correct provider:xml<connectionStrings> <add name="OracleConn" connectionString="Data Source=YOUR_TNS_NAME;User Id=myUser;Password=myPass;" providerName="Oracle.DataAccess.Client" /> </connectionStrings> -
Ensure the
providerNamematches the invariant name of the unmanaged driver:Oracle.DataAccess.Client.
-
Alternative Approach Without Installing the Driver
If installing the data provider is not possible, manually register the provider as described in the following article: Registering SqlDataSource Data Providers Without Installing Driver.
Although the example uses the
Npgsqlprovider, the same concept applies to other providers likeOracle.DataAccess.