0
votes

I'm connecting my application with Oracle database but it gives above error when I trying to login my application.

I'm already tried to different changes in tnsnames.ora file.

Following code is in my listener.ora file:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\DELL\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\DELL\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = C:\app\DELL

And following code is in tnsnames.ora file:

XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xe) ) )

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

ORACLE_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) )

1
That is not the contents of tnsnames.ora. That is listener.ora, which is not the problem. Please edit the question and show the code that you use to connect to the database. thanks.OldProgrammer
<add name="DSN" connectionString="DATA SOURCE=localhost;USER ID=ocr_test;PASSWORD=pass;" providerName="Oracle.DataAccess.Client"/> I'm using above ConnectionString in my web.config fileSalman Elahi

1 Answers

0
votes

DATA SOURCE should be set to the TNS name, not localhost so:

<add name="DSN" connectionString="DATA SOURCE=XE;USER ID=ocr_test;PASSWORD=pass;" providerName="Oracle.DataAccess.Client"/>

FYI also, ConnectionStrings.com is a great reference.