I use ODP.NET, Managed Driver Beta (Oracle.ManagedDataAccess.dll) in my C # application to access the Oracle database. This needs to be replaced with the native version of ODP.NET to remove all local dependencies on Oracle Client 10g / 11g / etc. so it does not need to be installed locally. This is the solution I found here .
This is my C # code:
new OracleConnection("Data Source=ABCDEFG1;User Id=myuserid;Password=mypassword;").Open();
This line is reached, and the object was OracleConnectioncreated successfully, which allows you to successfully load all the dependencies. However, when called, Open()it throws an OracleException. Error message:
Network Transport: Cannot resolve connection host name
My organization searches for host names using LDAP, and this is done through ORA files using the DIRECTORY_SERVER parameter. However, it is difficult for me to get it for this using a managed version of ODP.NET. ORA files are stored in C: \ Apps \ oracle \ network \ admin.
tnsping in my data source ("ABCDEFG1") works fine. So, I used tnsping output and added an entry for ABCDEFG1 to tnsnames.ora using this output. My application has successfully connected. So, I know that it definitely finds and uses ORA files, but for some reason it will not perform an LDAP search that uses unmanaged ODP.NET (in other applications).
Did anyone who used this new managed ODP.NET know about this problem or what could I do wrong?
source