title: ASP.NET/C# connect to Oracle DB
body: <p>I need to access a view on an oracle server with an ASP.NET website.  It works if I debug the website through visual studio(press F5 in VS2012), but when I go to the version hosted on my local IIS (LocalHost/) I get this error: </p>
  
  <pre><code>Oracle.DataAccess.Client.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
  </code></pre>
  
  <p>A lot of the information I'm finding is related to the deprecated <code>System.Data.OracleClient</code> and I'm using <code>Oracle.DataAccess.dll</code> File version 4.112.3.0, Assembly version 2.112.3.0. </p>
  
  <p>I set the AppPool it's running in to <code>Enable 32-Bit Application=True</code> based on some other people with a similar issue, I think everything else is default settings.</p>
  
  <p>I've tried using the gacutil to make sure it is installed in the gac.</p>
  
  <p>I also made a small winForms application that works and can access the data.</p>
  
  <p>I've tried a couple connection strings:</p>
  
  <p>This one works:</p>
  
  <pre><code>"Data Source=SOURCE;Persist Security Info=True;Password=****;User Id=****;"
  </code></pre>
  
  <p>This one doesn't work, I can't figure out a valid <code>SERVICE_NAME</code>:</p>
  
  <pre><code>"user id=****;password=****;data source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=****)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=****)));"
  </code></pre>
  
  <p>I always get this error:</p>
  
  <pre><code>Oracle.DataAccess.Client.OracleException: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
  </code></pre>
  
  <p>Places I've looked for <code>SERVICE_NAME</code></p>
  
  <p>I checked the connection I was able to establish with the first connection string and the <code>SERVICE_NAME</code> was either blank or <code>sys$users</code> depending on the query I ran.</p>
  
  <p>I found three files named <code>tnsnames.ora</code>; one was completely blank, the <code>SERVICE_NAME</code> in the other two were <code>Worker</code> and <code>&lt;database service name&gt;</code>.</p>
  
  <p>NOTE: I don't have access to the server, just credentials for this one view.</p>