Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

string constr = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=spp01)(PORT=1521))(CONNECT_DATA=(SID=Global)));User Id=SYSMAN;Password=testman3";
string ProviderName = "Oracle.DataAccess.Client";

DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);

I have asp.net application to show gridview.For a gridview datasource, I am using data from oracle database,but I could not connect with oracle database. I am able to connect to oracle in console and winforms application,but not in asp.net. I have installed 64bit ODAC. The ORACLE.DATAACCESS version is 2.112.3.0. I have checked machine.config entries in Framework64 v2.0.50727 and v4.0.30319

the machine.config contains following

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.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/
CPU = x64 Framework=3.5

When I run ASP.net application, I get the following error

System.ArgumentException was unhandled by user code
Message=Failed to find or load the registered .Net Framework Data Provider.
Source=System.Data
StackTrace:
at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)

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

How do I resolve this error?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900