I've got a local copy of an ASP.NET web application running in Visual Studio 2010. The code is an exact duplicate of the code running on my dev environment.
When I try to connect to my Oracle database through ASP.NET, it throws a "TNS could not resolve the connect identifier specified." The weird thing is this database is in my TNSNAMES.ORA file, and when I use TNSPING or Microsoft Data Link to connect, it works fine.
I tried tinkering with the permissions on my Oracle directory, but that didn't seem to help.
Make sure you have installed the Oracle Database client (x86 or x64).
Make sure you have the PATH configured to use the Oracle bin folder:
Make sure your tnsnames.ora file is in the directory:
You can try and use the following connection string:
Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=MYDATABASE)));User ID=myusername;Password=mypassword;