Reputation: 351
I'm trying to open an OracleConnection on Visual Studio (c#) to join a Database with this command:
OracleConnection conn = new OracleConnection("Data Source=((DESCRIPTION=(ADDRESS_LIST =(ADDRESS=(PROTOCOL=tcp)(HOST=XX.XXX.X.XXX)(PORT=XXXX)))(CONNECT_DATA=(SERVICE_NAME=DEPL_D)(SERVER=xxxxx0xx)));User Id=X_XXX_XXX; Password=XXXXXXXXXX");
conn.Open();
my tnsnames.Ora contains the connection string like this:
DEPL_D.WORLD=
(DESCRIPTION=
(ADDRESS_LIST =
(ADDRESS=
(PROTOCOL = tcp)
(HOST = XX.XXX.X.XXX)
(PORT = XXXX)
)
)
(CONNECT_DATA =
(SERVICE_NAME = DEPL_D)
(SERVER = XXXXXXXXXX)
)
)
On the conn.Open();
I have the message ORA-12533: TNS: illegual ADDRESS parameter
After having searched on the net, It seems it's a problem on my tnsnames.oRA
I have done a test SQL+ with the administrator of the database (on audio) and it works. But It doesn't with visual studio.
If anybody has any idea, everything can helps.
Thanks in advance,
Greetings,
Flo
EDIT1:
I have tried to edit the (CONNECT_DATA =
(SERVICE_NAME = DEPL_D)
(SERVER = XXXXXXXXXX)
)
with (CONNECT_DATA =
(SID=DEPL_D)
but it doesn't works too.
Upvotes: 0
Views: 15433
Reputation: 144
Guessing from what you've provided: The SERVICE_NAME in the connect string is not the same SERVICE_NAME from your tnsnames.ora file.
Also, why did you censor the SERVER parameter ? Only possible values are SHARED, DEDICATED or POOLED. No ip address or hostname here.
Upvotes: 0