I am new to C# and trying to connect to an Oracle database in a simple piece of code. I have been getting a lot of connection errors and have tried to solve them through Google search and solved them.
I am now at a point that I am getting an error at the conn.Open();
statement:
An unhandled exception of type 'Oracle.DataAccess.Client.OracleException' occurred in Oracle.DataAccess.dll
Additional information: External component has thrown an exception.
I don't know what this error means. I tried and searched a lot but couldn't find anything for this.
Code :
string connection_string = "Data Source=localhost;Persist Security Info=True;User ID=system;Password=6677";
OracleConnection conn = new OracleConnection(connection_string);
conn.Open();
I also tried many other connection_string
including
Data Source=(DESCRIPTION =" + "(ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521))" + "(CONNECT_DATA =" + "(SERVER = DEDICATED)" + "(SERVICE_NAME = XE)));" + "User Id=system;Password=6677;"
Nothing worked.