We are switching from the obsolete System.Data.OracleClient. I have switched all the references in the ASP.NET 2.0 code, however when I try to access the database server using ODP.NET calls I get ORA-12154: TNS:could not resolve the connect identifier specified. This works when I use System.Data.OracleClient on the same machine. Any suggestions about what is going wrong here?
2
votes
3 Answers
2
votes
You can avoid a dependency on Tnsnames.ora altogether, and go for the "independent" connection string in format:
Data Source =(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID))); User Id =myUsername; Password =myPassword;
BTW, you can look at connectionstrings.com/oracle for a quick, in-your-face list of supported connection string formats.
1
votes