I have a frustrating error. I'm connecting to Oracle (or trying to) from both a Winforms app and Asp.net page.
Winforms - no problem, Asp.Net - lots of problems.
Error I'm getting (running from IIS) is:
ORA-12545: Connect failed because target host or object does not exist
To me it this message might indicate that either my connection string is wrong or that Oracle is off, or firewall issues, but I'm using the same connection string and code that is working from Winforms on the same machine.
Any idea other ideas what might cause this error?
Code that fails:
string conn = "User Id=172.xx.xx.xxx ;Password=xxx;Data Source=(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=xx)(PORT=1521)) (CONNECT_DATA=(SID=xxx)));
OracleConnection oc = new OracleConnection(conn);
EDIT:
Full Stack:
ORA-12545: Connect failed because target host or object does not exist
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Oracle.DataAccess.Client.OracleException: ORA-12545: Connect failed because target host or object does not exist
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OracleException (0x80004005): ORA-12545: Connect failed because target host or object does not exist]
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) +1563
Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) +59
Oracle.DataAccess.Client.OracleConnection.Open() +4899
UDWWeb.Pages.Availability.Button1_Click(Object sender, EventArgs e) +49
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563