I am working in .Net Windows Application. In App.Config i had given the connection string like this…
<add connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.101)(PORT=1521)))(CONNECT_DATA=(SID=PROD)(SERVER=DEDICATED)));User Id=TEST;Password=TEST;" providerName="System.Data.OracleClient" name="ConnectionString" />
I am doing a update process. Once the breakpoint reaches the update method, i am getting the message like this..
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
What should i do for this…
My tnsnames.ora is,
PROD = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = Prod)
)
)
As I remember when we want to specify a connection string for an Oracle connection, the service name should be provided and the rest of information will be loaded from that service name. As Romil said in the comment, you have to make a Service Name in tnsnames.ora. There is a GUI tool for creating the service names. A Service Name is a connection specifier conceptually that everything needed for the connection will be provided in it.
Use this to get more info :
Quick Start to Oracle Net Connections