DomPazz DomPazz - 9 months ago 75
C# Question

ORA-12154 -- working in SQL PLUS not in C#

I have a working C# application running on my computer. I have given it to a colleague and he gets the dreaded ORA-12154 ERROR. After much searching and trying, we are at a loss at what to try next.

C# makes a connection like

using (var connection = new OracleConnection(ConnectionString))

The ConnectionString has a value of
"Data Source=MY_TNS_ENTRY;USER ID=usernm;Password=passwd"

The application includes the Oracle.ManagedDataAccess.dll file.

Both machines have the Oracle 64Bit client installed (11g 11.2.0). Both TNSNAMES files are identical.

On my colleague's computer he can run
sqlplus usernm/passwd@MY_TNS_ENTRY
at the command line and connect to the database. When the C# app runs it throws the ORA-12154 ERROR.

What else should we be checking to find the cause of this error?


I assume that it is using a different TNS names file and that in that one the MY_TNS_ENTRY does not exist. Check out this question to see how to check which file it is using.