イライラするエラーがあります。Winforms アプリと Asp.net ページの両方から Oracle に接続しています (または接続しようとしています)。
Winforms - 問題ありません。Asp.Net - 多くの問題があります。
私が得ているエラー(IISから実行中)は次のとおりです。
ORA-12545: Connect failed because target host or object does not exist
私にとって、このメッセージは、接続文字列が間違っているか、Oracle がオフになっているか、ファイアウォールの問題を示している可能性がありますが、同じ接続文字列と、同じマシン上の Winforms から動作しているコードを使用しています。
このエラーの原因となる他のアイデアはありますか?
失敗するコード:
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);
編集:
フルスタック:
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