I'm performing an OracleConnection to contact a distant DataBase, like this:
OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION(ADDRESS_LIST=(PROTOCOL=TCP)(HOST=XX.XX.XX.XX)(PORT=XXXX)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XXXXX));User Id=XX_XXX_XXX; Password=XXXXXXXXXXX");
Every informations hidden are correct and correspond to the Oracle Database.
When I do conn.Open();
I have the error: ORA-12514: TNS: connection identifier specified could not be resolved
I've heard it's probably because of the tnsnames.ORA I have copied/past the tnsnames.ORA of a colleague to mine and nothing changed.
I have searched on many forums and websites, noone seems to get my answer.
Thanks in advance for your help.
Greetings,
Flo.
EDIT1:
After having tried a SQLplus connection on command-line, it worked. Visual studio seems to be the problem?
Check your connection string. It seems like you are missing a pair of parentheses:
OracleConnection conn = new OracleCollection("Data Source=((DESCRIPTION(ADDRESS_LIST=(PROTOCOL=TCP)(HOST=XX.XX.XX.XX)(PORT=XXXX)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XXXXX)));User Id=XX_XXX_XXX; Password=XXXXXXXXXXX");