Connect to an Oracle database

后端 未结 3 1792
情书的邮戳
情书的邮戳 2021-02-14 22:20

I\'m trying to connect to an Oracle database but when the the code is executing the line:

con = new OracleConnection(oradb);

It gives this erro

相关标签:
3条回答
  • 2021-02-14 22:59

    I ended up referencing the ManagedDataAccess.Client instead of just the Data.Access.Client one and it worked.

    0 讨论(0)
  • 2021-02-14 23:01

    I was getting that error in my test project. The problem was that I was opening Visual Studio from a command line that had an old PATH. After opening everything fresh, it worked.

    Check the PATH from your code, and make sure the oracle folder is in the PATH.

    0 讨论(0)
  • 2021-02-14 23:09

    The PATH setting is not necessary. I solved the same issue with a copy of the oraons.dll into dhe ORACLE_HOME\bin folder and after that the installation works.

    There is a difference between an Oracle setup via installer and the xcopy depoyment. I don't now why. Both installations had the same registry setting:

    HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ODP.NET\4.112.4.0\DllPath 
    

    and the DllPath points to the BIN folder of the ORACLE_HOME. That means a PATH setting to the BIN folder of the ORACLE_HOME does not help. An additional PATH to the ORACLE_HOME of the client would help. I think that is not necessary. Only a copy of the oraons.dll into the BIN is enough.

    0 讨论(0)
提交回复
热议问题