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

前端 未结 4 1542
谎友^
谎友^ 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 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();
    }
    

提交回复
热议问题