ORA-12504 Error with ODP.NET
609045Jun 5 2009 — edited Jun 8 2009Help! I've been going round-n-round with this one for the last day and a half.
I'm getting an Oracle exception ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA whenever I attempt to establish a connection from C#using ODP.NET. I've looked through the various other posts on this topic and tried everything I could. Nothing so far has resolved the issue.
The connection string used to attempt the connection is:
<add name="ConnectionStringOracle" connectionString="Data Source=XXX;Persist Security Info=True;User ID=username;Password=password" providerName="System.Data.OracleClient"/>
The tnsnames.ora file contains this entry:
XXX.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = tcp.world)(PROTOCOL = TCP)(Host = hostname)(Port = 1521))
)
(CONNECT_DATA =
(SID = XXX) (SERVER = DEDICATED)
)
)
The sqlnet.ora file contains the following:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
#NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
names.default_domain = (world)
names.default_zone = (world)
The machine on which this is being experienced is running XP with current SP and VS 2008 Pro. The Oracle 9i Client was installed first, then the 11g ODT with ODAC installation. I can connect using SqlPlus with the 9i client but not from within the C# program as above.
Any ideas of what might be causing the failure?
Thanks,
Jim