I am trying to connect to Oracle Express 11g. I am using ODAC 12c with Visual Studio 2015. Here's how I am trying to connect:
OracleConnection con;
con = new OracleConnection("User Id=SYSTEM;Password=manager;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.1.22)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE)))");
con.Open();
Application crashes and give Exception
(not OracleException
) : Object reference not set to an instance of an object.
If I do not set connection string, it gives OracleException
as expected. What's wrong?