Reputation: 1171
I've got a little problem between oracle and C#. I can't seem to connect to my database(=localhost) within my application. I'm using Oracle XE11.2. The error occurs everytime I'm calling "conn.Open()" and Oracle returns this error: {"ORA-12154: TNS:could not resolve the connect identifier specified"}.
I'm 100% sure that the User Id and the Password are correct because I can login to the database via SQL Developer. I think the problem might be in the data source but I'm not sure. Anyone who can help out?
Here is my code:
string connstring = "Data Source=xe;User Id=Software;Password=Software";
//Open connection
OracleConnection conn = new OracleConnection(connstring);
conn.Open();
Upvotes: 0
Views: 1052
Reputation: 96
Did you try tns ping "tnsping xe" from the machine where you are running your program?
Upvotes: 1