Oracle.DataAccess.Client.OracleException at Connection.Open()

时光总嘲笑我的痴心妄想 提交于 2019-12-24 03:22:31

问题


this question can look like a clone of others, but I can't find a correct answer to this one. This is my scenario: I have a C# software called by webservices that need to write to an oracle database. In my test server no problems, it works like a charm, but, in another equal server it gives to me this error:

Oracle.DataAccess.Client.OracleException at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) at Oracle.DataAccess.Client.OracleConnection.Open()

With no other messages. I thought that it is an error installing oracle client, but, another small application that I wrote to test oracle connection works:

var connectionString = ConfigurationManager.AppSettings["connectionString"];
using (OracleConnection nwindConn = new OracleConnection(connectionString))
{
   nwindConn.Open();
   Console.WriteLine("opened");
}

ConnectionString:

Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=thisdatabase.thisinstance)(PORT=1521))(LOAD_BALANCE=yes)(FAILOVER=on)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=serv)(FAILOVER_MODE=(TYPE=SESSION)(METHOD=BASIC)(RETRIES=180)(DELAY=5))));User ID=myuser;Password=mypsw;

So, the problem, I think is in the application configuration, but why the same works on other server? I tried to edit Project and Solution debug platform Configuration but the problem still exists.. Any suggestions?


回答1:


the problem was the IIS user with application was started, "Application pass-trough". I changed it with my administrator user and it works like a charm. Thank you anyway.




回答2:


in the case of using 11g just go to your oracle folder ( mine C:\oracle) and look for the files Oracle.dataAccess.dll you may find 4 files copy them in the BIN of the application and it will all be fine.



来源:https://stackoverflow.com/questions/22352812/oracle-dataaccess-client-oracleexception-at-connection-open

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!