When i execute my code i have the following error :
ORA-12550 : The supplied connect descriptor contains illegal syntax.
I checked if i have the correct syntax on http://www.orafaq.com/wiki/Tnsnames.ora and nothing seem bad so i don't know whence can this error.
public static OracleConnection GetDBConnection(string host, int port, String sid, String user, string password)
{
string connString = "Data Source=(DESCRIPTION=(ADRESS=(PROTOCOL=tcp)(HOST="+host+")(PORT="+port+"))(CONNECT_DATA=(SERVICE_NAME="+sid+")));User Id="+user+";Password="+password;
OracleConnection conn = new OracleConnection();
conn.ConnectionString = connString;
return conn;
}
First of all, "ADDRESS" has double "D".
Also ADDRESS is a part of ADDRESS_LIST so try
(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =
your_host)(PORT = your_port) ) )