ODP.NET Connection exception

主宰稳场 提交于 2019-12-04 04:53:38

This guy helped me solve my problem https://pravsdatums.wordpress.com/2013/12/16/ocac-12c-and-visual-studio-developer-tools/#comment-1

The solution was to remove LDAP from NAMES.DIRECTORY_PATH in the sql.ora file. This file is located on your client home directory (this path can be found on one of the key in the registry under HLM/SOFTWARE/ORACLE). So the content of the file went from

SQLNET.AUTHENTICATION_SERVICES= (none)

NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, EZCONNECT)

To

SQLNET.AUTHENTICATION_SERVICES= (none)

NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES)

And now it works ! I don't know why it was working on my development machine (maybe because Oracle is not installed on it).

Hope it can help somebody else !

My guess is the connection string is an issue. Some suggestions:

  1. Can you connect to the database using SqlPlus or SqlDeveloper locally?
  2. If the answer to (1) is true, then I would try to modify _dbConnection.ConnectionString directly in the code until I got it right. If you are using tnsnames.ora for sqlplus connections, I would take the code from there are put it in the connection string and verify the connection as a sanity check. I know this is not your ultimate objective, but you must start somewhere.
  3. If the answer to (1) is false, I would work on getting that connection right first before attempting a connection through ODP.Net.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!