0
votes

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: -

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

1
No inner exception? Is ODP deployed on your server? Why aren't you using the Oracle Managed Driver which has no external dependencies?mason
Not sure if this is the cause of your problems, but to specify the datatype of a parameter you should use the appropriate enumeration not a string. For Oracle you have to use OracleDbType.Varchar2Steve
Thanks... Oracle Managed Driver solved the issue..!Sahil

1 Answers

0
votes

Moving to ManagedDataAccess solved the issue for me