0

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();
2
  • 1
    Do you have access to the server from your machine? Commented Oct 19, 2015 at 19:41
  • Sorry, I forgot to tell you that the database was running on localhost. I adapted the post. Commented Oct 19, 2015 at 20:06

1 Answer 1

1

Did you try tns ping "tnsping xe" from the machine where you are running your program?

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, running tnsping xe was the solution. After I adjusted the data source it worked!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.