Discussion:
Oracle.DataAccess.Client.OracleException ORA-12154: TNS:
(too old to reply)
j***@gmail.com
2006-08-15 17:53:50 UTC
Permalink
I just installed ODP.net 10.2.02 on my local machine (Windows XP Pro)
running IIS.

I have created a sample webservice in VS2003, connecting to localhost.
I am getting:
Oracle.DataAccess.Client.OracleException ORA-12154: TNS:could not
resolve the connect identifier specified at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx*
pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32
errCode, OracleConnection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at Oracle.DataAccess.Client.OracleConnection.Open()
at MikesWebservice.Service1.GetNumberOfLogons() in
c:\inetpub\wwwroot\webservices\MikesWebservice\Service1.asmx.vb:line 69

1- I am using tnsnames.ora file that is in the install path for
ODP.net: C:\oracle\product\10.2.0\client_1\network\ADMIN

2- My SQLNET.ora contents:
TRACE_LEVEL_CLIENT = OFF
#sqlnet.authentication_services = (NONE)
names.directory_path = (TNSNAMES, HOSTNAME)
#names.default_domain = world
name.default_zone = world
automatic_ipc = off

3- My TNSNames.ora file as needed for my connection:
NPD1.world=(DESCRIPTION=(ADDRESS_LIST =(ADDRESS =(COMMUNITY =
TCP.world)(PROTOCOL = TCP)(Host = neolynx.neopostinc.com)(PORT =
1521)))(CONNECT_DATA=(SID=NPD1)(SERVER=DEDICATED)))

4- My Code related to the Connection open:
Dim connectionString As String = "User Id=webmgr;Password=hayward1;Data
Source=npd1.world"
Dim oraCon As OracleConnection
Dim returnNumber As Double
oraCon = New OracleConnection
oraCon.ConnectionString = connectionString
oraCon.Open()

Dim oraCmd As OracleCommand
oraCmd = oraCon.CreateCommand()
oraCmd.CommandText = "select count(*) from
nweb_customer_logons;"
Dim oraReader As OracleDataReader
oraReader = oraCmd.ExecuteReader()
While (oraReader.Read)
returnNumber = oraReader.GetDouble(0)
End While
oraReader.Dispose()
oraCmd.Dispose()
oraCon.Dispose()

I can use TNSPing from the \bin\ directory under the OPD.net install. I
have verified there are no paranthesis in any of the folder paths, and
have verified that Authenticated Users, and the ASP_NET user have
access to those folders.

I have no clue where to go from here. Thanks for any insight.
j***@gmail.com
2006-08-15 20:43:26 UTC
Permalink
I fixed this. I changed the DataSource to:
Data Source=//host.domain.com:port/fully.qualified.service
Milind Patil
2009-06-30 13:59:33 UTC
Permalink
Simply Great! FQDN worked for me. Looks like it bypasses all the TNS, DSN etc

From http://www.developmentnow.com/g/40_2006_8_0_0_805582/Oracle-DataAccess-Client-OracleException-ORA-12154-TNS.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com/g/

Loading...