I can open a connection with SQL Developer but when i do the same with .NET returns me ORA-12514 In SQL Developer



In my .NET proyect, Web.config:

&lt;add name="DBConection" providerName="Oracle.ManagedDataAcess.Client" connectionString="Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.27.32.27)(PORT=1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME=BDTEST1)));Password=pass;User ID=user;" /&gt;


When trying to connect with the application it gives me:

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor


I have modify all TNSNames.ora files I could find in my pc, but the database is in another server that i cannot acces. Is the problem in my PC or is something wrong in the server that impede this connection?

EDIT:

This is the TNSNames.ora, in fact, all the TNSNames.ora I could find in mi PC, because I don't know what is the file the application is using, or if it is even in my pc.

    BDTEST1 =
   (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.27.32.27)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = BDTEST1) 
    )
  )
Your database instance "BDTEST1" will, by default, register service "BDTEST1" in the Oracle Listener. Oracle Listener will expose that SERVICE_NAME. 

Replace SERVICE_NAME=BDTEST with SERVICE_NAME=BDTEST1 for your .NET config and you can connect.

Before you enter the app layer, make sure your connect-string is correct.
use sqlplus or SQL Developer (custom connect):

sqlplus user/pass@\"(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.27.32.27)(PORT=1521))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME=BDTEST1)))\"


If you connect using the SID the connect-string will be:

sqlplus user/pass@\"(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.27.32.27)(PORT=1521))(CONNECT_DATA = (SERVER = DEDICATED)(SID=BDTEST1)))\"


I think you have to escape the " on Windows...not sure.

Side note: Behind a service there can be multiple oracle database hosts and DR hosts. If you connect using SID, you will always connect to the named instance (SID). If this one is down, no failover can happen. So you better use SERVICE_NAME. Ask you admins to provide it to you.    

Best of luck!