I have a .aspx page referencing Oracle.DataAccess. I'm able to launch the app through visual studio and it works well. My VS version is 2012, IIS is 7.5, OS is Win 7 and ODP is 3.5.
However, when I try to deploy it in IIS, it gives me an exception. I have tried the following so far: -
Tried copying the DLLs as per - How can I deploy a .NET application that uses ODAC without installing the whole component to the user?
Tried installing ODP 3.5, and then publishing it through visual studio.
Tried editing the web.config and giving it the full connect string instead of just the DB alias: - (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST= myhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=my_srv)))
I'm running out of ideas. Here's the code and the exception error. Please help: -
Code:
string oradb = "Data Source=MY_SRV;User Id=USERID;Password=PWD;";
Oracle.DataAccess.Client.OracleConnection conn = new Oracle.DataAccess.Client.OracleConnection(oradb);
Oracle.DataAccess.Client.OracleCommand cmd = new Oracle.DataAccess.Client.OracleCommand("myOracleStoredPrc", conn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.Add("p_db_name", "varchar2").Value = "abc";
cmd.Parameters.Add("p_user_name", "varchar2").Value = "xyz";
conn.Open();
cmd.ExecuteNonQuery();
conn.Dispose();
Exception I get when I launch the iis site:
Unhandled Execution Error 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: 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)] Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck) +1532 Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) +49 Oracle.DataAccess.Client.OracleConnection.Open() +4800 WebApplication1.ResetOraclePwdForm.Page_Load(Object sender, EventArgs e) +72 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772