title: How to construct .NET connection string to Oracle without TNS?
body: <p>I have a Sharepoint 2010 .NET 3.5 system running on my local Windows 7 machine with IIS. I have been unable to connect to our corporate Oracle database via Oracle.DataAccess.dll. The error message I get in my .NET webapp (sharepoint) is "ORA-12154: TNS: could not resolve the connect identifier specified".</p>
  
  <p>Here's the good news:</p>
  
  <ul>
  <li>I can connect to this DB fine with TOAD, from my same PC.</li>
  <li>Our TEST server can connect fine to the DB through sharepoint/.net and everything.</li>
  </ul>
  
  <p>So it feels like I'm very close and just need to tweak something. A bunch of articles I read say to cut out the TNS/ora file and go straight from .net to the DB by constructing a .net connection string thusly:</p>
  
  <p>connString="user id=usridname;password=yourpassword;data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hostnamehere)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=servicenamehere)));"</p>
  
  <p>I would love to use this approach. I have the username and password, but I don't know how to discover the other parts. It's probably a simple thing to discover the hostname, port, and servicename by examining my TOAD connection, or by peeking in some file on the TEST server that works. But I have no idea where to look, either in toad, or on the test server where it works. I have full remote desktop admin access to the test server, so I can look at anything.</p>
  
  <p>Any ideas?</p>