Problem with .Net ODAC 11g -- >> ora-12514: TNS: listener does not currently know of service requested in connect descriptor


We've got a 32 bit .Net windows application which uses ODAC 10g (1.x) to connect to a 10g database on the backend.
Things work fine in this deployment.

We're in the process of setting up a new development machine.
This machine has ORACLE 11g (64 bit) installed on it.
We're running into issues connecting the the database.

This is the code block we're using to connect to the database:
string dataString = "user id=xxx;password=\"xxx\";data source=localhost:1521/ORCL";
using (OracleConnection oraconn = new OracleConnection(dataConn))

Oracle.DataAccess.Client.OracleCommand cmd = new OracleCommand(sOraSQL, oraconn);
cmd.CommandType = CommandType.Text;
Oracle.DataAccess.Client.OracleDataAdapter da = new OracleDataAdapter(cmd);

DataTable dt = new DataTable();

return dt;

We get an exception on the "oraconn.Open()" command.
ora-12514: TNS: listener does not currently know of service requested in connect descriptor

Here is what the TNSNAMES.ORA file looks like:
# tnsnames.ora Network Configuration File: C:\app\DjM\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

      (SID = CLRExtProc)

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (SERVICE_NAME = orcl.168.1.100)

This is what the SQLNET.ORA file looks like:

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.


This is what the connection string looks like:
"user id=xxx;password=\"xxx\";data source=localhost:1521/ORCL"

We are able to run SQLDeveloper and point to the same SID (ORCL) and we can connect to the DB instance fine.

We were also able to install 11g 32 bit ODAC on the original machine and it worked fine there.

This has got to be something config related with tnsnames or something along those lines.

Any and all help/suggestions would be appreciated there.

jxbmaSoftware ConsultantAsked:
Who is Participating?
slightwv (䄆 Netminder)Connect With a Mentor Commented:
"We've got a 32 bit .Net windows application"
"This machine has ORACLE 11g (64 bit) installed on it."

The Bit versions need to match.  The 32Bit compiled app cannot reference 64Bit DLLs.

You will also need the exact ODAC version used to compile the app or you will run into version issues.

There might be an app.config tweak you can do for the version but I've never used it.

It is discussed here:
Amitkumar PSr. ConsultantCommented:
What is the SID on your oracle server..

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      [b](SERVICE_NAME = orcl.168.1.100)[/b]

Open in new window

You need to provide the SID with the SERVICE_NAME. Check that SID is created with "orcl.168.1.100" name, as sometime oracle truncate some characters from the SID.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.