ORA-12154: TNS:could not resolve service name? - Oracle 9i 32bit version / Windows 64bit machine / Visual Studio 2010 / ASP.NET http://forums.asp.net/t/1793878.aspx/1?ORA+12154+TNS+could+not+resolve+service+name+Oracle+9i+32bit+version+Windows+64bit+machine+Visual+Studio+2010+ASP+NET+Wed, 18 Apr 2012 12:06:23 -040017938784937111http://forums.asp.net/p/1793878/4937111.aspx/1?ORA+12154+TNS+could+not+resolve+service+name+Oracle+9i+32bit+version+Windows+64bit+machine+Visual+Studio+2010+ASP+NET+ORA-12154: TNS:could not resolve service name? - Oracle 9i 32bit version / Windows 64bit machine / Visual Studio 2010 / ASP.NET <p>Hi Guys,</p> <p>I have Oracle 9i 32bit version&nbsp;installed in my Windows 64bit machine. I am using Visual Studio 2010 /&nbsp;ASP.NET. When I try to establish a OracleConnection I am getting &quot;ORA-12154: TNS:could not resolve service name.&quot; error.&nbsp;When I tnsping it's getting OK.</p> <p>AND When I set my connection string as <span size="2" face="Consolas" color="#a31515" style="font-family:Consolas; color:#a31515; font-size:small"> <span size="2" face="Consolas" color="#a31515" style="font-family:Consolas; color:#a31515; font-size:small"><span size="2" face="Consolas" color="#a31515" style="font-family:Consolas; color:#a31515; font-size:small">&quot;Data Source=(DESCRIPTION=(CONNECT_DATA=(SID=TEST)(SERVICE_NAME=SOMETHING))(ADDRESS=(PROTOCOL=TCP)(HOST=SOMETHING)(PORT=MYPORT)))... </span></span></span></p> <p><span size="2" face="Consolas" color="#a31515" style="font-family:Consolas; color:#a31515; font-size:small"><span size="2" face="Consolas" color="#a31515" style="font-family:Consolas; color:#a31515; font-size:small"><span size="2" face="Consolas" color="#a31515" style="font-family:Consolas; color:#a31515; font-size:small"></span></span></span>I am getting the error &quot;ORA-06413: Connection not open.&quot;. So I am really confused here with&nbsp;what is happening around.</p> <p>Please, I am really appreaciating your all professional help. Thank you.</p> <p>Happy Coding.</p> <p>Regards,</p> <p>Jaliya</p> 2012-04-17T16:14:14-04:004937145http://forums.asp.net/p/1793878/4937145.aspx/1?Re+ORA+12154+TNS+could+not+resolve+service+name+Oracle+9i+32bit+version+Windows+64bit+machine+Visual+Studio+2010+ASP+NET+Re: ORA-12154: TNS:could not resolve service name? - Oracle 9i 32bit version / Windows 64bit machine / Visual Studio 2010 / ASP.NET <p>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:</p> <p><a href="http://www.connectionstrings.com/oracle">http://www.connectionstrings.com/oracle</a></p> 2012-04-17T16:37:50-04:004937175http://forums.asp.net/p/1793878/4937175.aspx/1?Re+ORA+12154+TNS+could+not+resolve+service+name+Oracle+9i+32bit+version+Windows+64bit+machine+Visual+Studio+2010+ASP+NET+Re: ORA-12154: TNS:could not resolve service name? - Oracle 9i 32bit version / Windows 64bit machine / Visual Studio 2010 / ASP.NET <p>Hi Guys,</p> <p>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?</p> 2012-04-17T16:57:47-04:004937178http://forums.asp.net/p/1793878/4937178.aspx/1?Re+ORA+12154+TNS+could+not+resolve+service+name+Oracle+9i+32bit+version+Windows+64bit+machine+Visual+Studio+2010+ASP+NET+Re: ORA-12154: TNS:could not resolve service name? - Oracle 9i 32bit version / Windows 64bit machine / Visual Studio 2010 / ASP.NET <p>I would suggest that you use the easy connection method like this:</p> <h3>Using the Easy Connect Naming Method (aka EZ Connect)</h3> <p>The easy connect naming method enables clients to connect to a database without any configuration.</p> &lt;div id=&quot;p0cs4&quot; class=&quot;cs_csbox&quot;&gt;Data Source=username/password@//myserver:1521/my.service.com;&lt;/div&gt; &lt;div class=&quot;cs_bi&quot;&gt; <p>Port 1521 is used if no port number is specified in the connection string.</p> <p>Make sure that EZCONNECT is enabled in the sqlnet.ora file. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)</p> <p>'//' in data source is optional and is there to enable URL style hostname values</p> &lt;/div&gt; 2012-04-17T16:59:57-04:004937624http://forums.asp.net/p/1793878/4937624.aspx/1?Re+ORA+12154+TNS+could+not+resolve+service+name+Oracle+9i+32bit+version+Windows+64bit+machine+Visual+Studio+2010+ASP+NET+Re: ORA-12154: TNS:could not resolve service name? - Oracle 9i 32bit version / Windows 64bit machine / Visual Studio 2010 / ASP.NET <p>Hi&nbsp;bbcompent1,</p> <p>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.&nbsp;</p> 2012-04-18T03:28:41-04:004938844http://forums.asp.net/p/1793878/4938844.aspx/1?Re+ORA+12154+TNS+could+not+resolve+service+name+Oracle+9i+32bit+version+Windows+64bit+machine+Visual+Studio+2010+ASP+NET+Re: ORA-12154: TNS:could not resolve service name? - Oracle 9i 32bit version / Windows 64bit machine / Visual Studio 2010 / ASP.NET <p>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?</p> 2012-04-18T12:06:23-04:00