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?