0
votes

I need to connect my ASP.NET Core (2.2) WebApp to Oracle DB.

I installed Oracle.ManagedDataAccess and follow the tutorial from Oracle page: https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/ODPNET_Core_get_started/index.html

My problem is, in Oracle DB I haven't 'Service_Name', only SID: enter image description here

When I try to connect, my conString looks like this:

string conString = "Data Source=XXXXXXXXX:XXXX;User Id=XXXX;Password=XXXX;";

But when I open connection, return this error:

ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

Should I try another method?

Thank you so much.

1
Why don't you have the service name? Perhaps you just need to ask the DBA. - EdStevens

1 Answers

0
votes

finally I build my connection string this way:

string conString = "Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XX.XX)(PORT = 1521)))(CONNECT_DATA=(SID=XXX))); User Id = XXX; Password = XXX;";