Last post Apr 18, 2012 12:06 PM by bbcompent1
Apr 17, 2012 04:14 PM|jaliya.udagedara|LINK
I have Oracle 9i 32bit version installed in my Windows 64bit machine. I am using Visual Studio 2010 / ASP.NET. When I try to establish a OracleConnection I am getting "ORA-12154: TNS:could not resolve service name." error. When I tnsping it's getting OK.
AND When I set my connection string as
am getting the error "ORA-06413: Connection not open.". So I am really confused here with what is happening around.
Please, I am really appreaciating your all professional help. Thank you.
Apr 17, 2012 04:37 PM|bbcompent1|LINK
With that method of connecting, it requires you to have the tnsnames.ora file or it might give you grief. Take a look at this list of oracle connection alternatives as they may be easier to implement:
Apr 17, 2012 04:57 PM|jaliya.udagedara|LINK
Everything is working perfectly in a Windows Application. But not in ASP.NET Web Application. So i guess there can't be anything wrong with tnsnames.ora file. Can it be some kind of permission issue?
Apr 17, 2012 04:59 PM|bbcompent1|LINK
I would suggest that you use the easy connection method like this:
The easy connect naming method enables clients to connect to a database without any configuration.
Port 1521 is used if no port number is specified in the connection string.
Make sure that EZCONNECT is enabled in the sqlnet.ora file. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
'//' in data source is optional and is there to enable URL style hostname values
Apr 18, 2012 03:28 AM|jaliya.udagedara|LINK
I don't have a sqlnet.ora file in my admin directory. The thing that I can't understand is, why is it that I can't connect from ASP.NET and I can connect from Windows Application.
Apr 18, 2012 12:06 PM|bbcompent1|LINK
Because they are two different animals alltogether. But if you try some of the other connection strings shown in connectionstrings.com it should work. The other possibility is your web server is being blocked by a firewall. Have you asked your IT department
if they block connections to Oracle in any way?