Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

ORA-12504: TNS: listener was not given the Service_name in connect_data

$
0
0

Hi.

I am trying to connect to Oracle Exadata 12 c database from a C# Web application ( VS2010).

I have used the below code

//web.config<add name="con" connectionString="DataSource=servername;userId=uid;password=pwd" providerName="Oracle.DataAccess.Client" />

// c# cs code
string oradb = System.Configuration.ConfigurationManager.ConnectionStrings["con"].ConnectionString;

OracleConnection conn = new OracleConnection(oradb);
conn.Open()

I am getting the error: ORA-12504: TNS: listener was not given the Service_name in connect_data , when the Open connection is called.

The tns entry has the below:

t1_exa_abc=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL = TCP)
(HOST=SERVERNAME)
(PORT=port number)
)
(CONNECT_DATA=
(SERVER=dedicated)
(SERVICE_NAME=t1_exa_abc.domain.com)
)
)

How to fix this?


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>