Unable to find the requested .Net Framework Data Provider in Oracle

前端 未结 4 1533
谎友^
谎友^ 2021-01-12 13:51

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

Id=SYSMAN;Password=testman3\";

相关标签:
4条回答
  • 2021-01-12 13:59

    Uninstall the 64bit ODAC and install the 32 bit ODAC.

    0 讨论(0)
  • 2021-01-12 14:17

    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()

    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.

    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.

    On installing the Oracle client from current user resolves the problem.

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

    0 讨论(0)
  • 2021-01-12 14:18

    You simply need the data provider. I had the same problem with Oracle 11g when deploying to a Windows Server 2008 R2 and after installing their data provider on the server it worked. Didn't work on the first shot though I had to restart the web app a few times.

    To check if you have the ODAC on the server simply dump this string to a log somewhere or anywhere you can see it:

    private String GetDbProviders()
    {
        // Retrieve the installed providers and factories.
        DataTable table = DbProviderFactories.GetFactoryClasses();
    
        StringBuilder bob = new StringBuilder();
    
        // Display each row and column value.
        foreach (DataRow row in table.Rows)
        {
            foreach (DataColumn column in table.Columns)
            {
                bob.AppendLine(" "+row[column]+" ");
            }
        }
    
        return bob.ToString();
    }
    
    0 讨论(0)
  • 2021-01-12 14:20

    This is one of the common issues that all .NET developer who ever using the Oracle Client as Database will face.

    Points to remember:

    • Make sure you have installed Oracle ODAC from Oracle.
    • Check if Oracle.DataAccess is properly installed:(Oracle.DataAccess should be there in DbProviderFactories section)
      • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
      • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
    • If oracle 32bit is installed make sure you're building an application in 32x.
    • Even if you have 32bit/64bit system and 32bit/64bit application. You should refer the same Oracle.Database DLL version as on DbProviderFactories in machine.config

    Screenshot for reference

    Quick Links:

    • Download Path - http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html
    • Similar answer - ODP.NET Managed - Unable to find requested .Net Framework Data Provider
    0 讨论(0)
提交回复
热议问题