Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Null Reference Exception

800856Oct 4 2010 — edited Oct 5 2010
This worked fine a few times I tried later on I start getting this error.
As soon as it hit's the connection.open function it gives and exception saying Object reference not set to instance of an object.
These are the only lines of code I have in my code.

This is my code to connect to oracle 11g database.

OracleConnection orcl = new OracleConnection();
orcl.ConnectionString = "User Id=scott;Password=tiger;Data Source=orcl;";
orcl.Open();

This is the oracle DataAccess dll version
2.111.6.0

This is my stack trace.

" at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck)\r\n at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)\r\n at Oracle.DataAccess.Client.OracleConnection.Open()\r\n at test.SamplePage.Page_Load(Object sender, EventArgs e) in D:\\test\\test\\SamplePage.aspx.cs:line 18\r\n at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

I'm using VS2008

Please help.
Thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 2 2010
Added on Oct 4 2010
4 comments
1,214 views