Home » Infrastructure » Windows » Works fine in ASP.NET but fails in Console app (Oracle 10g)
Works fine in ASP.NET but fails in Console app [message #355387] Thu, 23 October 2008 22:23 Go to next message
king-kong
Messages: 9
Registered: October 2008
Junior Member
I have the exact same Oracle connection on the same server with the same userid, password, on the same network. It works fine in ASP.NET on on Vista, but will give "Object reference not set to an instance of an object." at the Open() method when used in a Console application on the same PC that was running the web server.

Oracle.DataAccess.Client.OracleConnection oc = new Oracle.DataAccess.Client.OracleConnection("....");
oc.Open(); <---


Any help is much appreciated.

PS: I repeat the same thing on a Windows Server and it's the same: fine on ASP.NET, not ok in a Console app.
Re: Works fine in ASP.NET but fails in Console app [message #355492 is a reply to message #355387] Fri, 24 October 2008 08:15 Go to previous message
king-kong
Messages: 9
Registered: October 2008
Junior Member
Let me re-phrase my problem.

I have an ASP.NET application that has a connection to an Oracle server. The application runs fine.

I now port over the exact same code to a console application. It fails at the .Open method with a null reference error.

I am using the Oracle.DataAccess.Client namespace and the actual code is as shown in my original message above.

Both applications are connecting to the same Oracle server, same database, same login credentials, same table, etc. Both the ASP.NET and the console application are also running on the same PC.
Previous Topic: about file's modified date
Next Topic: Old client silent install
Goto Forum:
  


Current Time: Sun Dec 04 18:41:09 CST 2016

Total time taken to generate the page: 0.08083 seconds