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!

OracleConnection.Open() throwing "Object reference not set to an instance of an object"?

The DonbotApr 28 2020 — edited Apr 28 2020

I have a legacy Windows application that uses odp.net with an unmanaged driver. I recently upgraded my laptop, which has both a newer version of Oracle than I had previously and Visual Studio 2019 (previously I was using 2017).

When I try running the app on my laptop, when it gets to an OracleConnection Open() call, it throws, "Object reference not set to an instance of an object."

Here is the code in question:

OracleConnectionStringBuilder ConnString = new OracleConnectionStringBuilder();

ConnString.DataSource = "MyDataSource";

ConnString.UserID = "MyUsername;

ConnString.Password = "HardCodedPasswordsAreBAD";

OracleConnection Conn = new OracleConnection(ConnString.ToString());

Conn.Open();

The Oracle.DataAccess.dll file is product version 4.122.1.20170524. Note that the database holding the data is running 18.0.0.0.

Do I need a newer version - and, for that matter, does one exist, or do I need to switch to the managed driver?

Comments
Post Details
Added on Apr 28 2020
1 comment
4,487 views