Oracle Connection String Without tnsnames.ora file for .net

by Vahid 12. July 2009 04:51

ever wanted to connect to an oracle database in your .net application (asp.net, windows client ect) but tnsnames.ora file was missing? ok,i just found a solution for this in connectionstrings.com. you can use the following connection strings to connect to an oracle database using both microsoft .net provider for oracle database and odp.net:

.NET Data Provider for Oracle

SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=yourHost)(PORT=yourPort))(CONNECT_DATA=(SERVICE_NAME=yourOracleSID)));uid=yourUsername;pwd=yourPassword;

Oracle Data Provider for .NET / ODP.NET

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;

Tags: , ,

.Net | Technical