I am getting the error while I am trying to connect to Oracle with my code in ASP.NET, this code is working in another machine, but it fails in my laptop, giving the below error.
Could not create an environment: OCIEnvCreate returned -1.
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: System.Exception: Could not create an environment: OCIEnvCreate returned -1.
Source Error:
Line 71: Dim objCmd As New OracleCommand
Line 72:
Line 73: objConn.Open()
Line 74: objCmd.Connection = objConn
Line 75: objCmd.CommandText = strSQL
Source File: C:\Inetpub\wwwroot\IFB\clsITODatabase.vb Line: 73
Stack Trace:
[Exception: Could not create an environment: OCIEnvCreate returned -1.]
System.Data.OracleClient.DBObjectPool.GetObject(Ob ject owningObject, Boolean& isInTransaction)
System.Data.OracleClient.OracleConnectionPoolManag er.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, OracleConnection owningObject, Boolean& isInTransaction)
System.Data.OracleClient.OracleConnection.OpenInte rnal(OracleConnectionString parsedConnectionString, Object transact)
System.Data.OracleClient.OracleConnection.Open()
IFB.clsITODatabase.CreateDataReaderOracle(String strSQL) in C:\Inetpub\wwwroot\IFB\clsITODatabase.vb:73
IFB.clsITODatabase.authenticateUser(String strUserID) in C:\Inetpub\wwwroot\IFB\clsITODatabase.vb:162
IFB.Global.Session_Start(Object sender, EventArgs e) in C:\Inetpub\wwwroot\IFB\Global.asax.vb:77
System.Web.SessionState.SessionStateModule.RaiseOn Start(EventArgs e)
System.Web.SessionState.SessionStateModule.OnStart (EventArgs e)
System.Web.SessionState.SessionStateModule.Complet eAcquireState()
System.Web.SessionState.SessionStateModule.BeginAc quireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
System.Web.AsyncEventExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously)
---------------------
I am tried all the options given through many resources which I searched in the net, still my problem persists, I have given the permissions to the ASPNET user to the Oracle directory, still I have this problem, any suggestions, even the oracle data provider is installed. Any suggestions please reply to me asap.
Thanks
Mohins