Search This Blog

Wednesday, September 18, 2013

Oracle connect problems from ASP.NET

Many people like me, might have faced the issue, where even after installing the Oracle client and doing all configurations right inside tnsnames.ora, may not be able to connect to Oracle database.

The Error message might read as "ORA-12154 :TNS:Could not resolve the connect identifier specified".

Here is a quick tip on how to connect. Instead of only mentioning the Service Name or the SID name in the Web.config, mention the entire connection description like below

<add key="OracleConnection" value="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host)(PORT=1521)))(CONNECT_DATA=(SID=oradev))); User Id=user_id; Password=password"/>

* The above method will definitely work if you are able to connect to your Oracle database using Oracle Net Configuration.