title: How to debug visual studio connection to oracle database (ORA-1254 & ORA-12638)?
body: <h2>Background</h2>
  
  <p>I am working a new job and trying to set up my local environment. At the moment, I cannot debug our web solutions on visual studio 2008 because I believe I did not configure oracle 11g correctly when I installed it (getting an ORA-1254-TNS: could not resolve identifier specified" error. TNS is not an issue because doing direct connect in the solution). So I am pretty sure I need to reconfigure or reinstall my local 11g oracle with the right installation parameters. </p>
  
  <h2>Problem</h2>
  
  <p>All previous developers have left before I even came. Nothing is documented. I do, however, have access to one of the machines where a developer was working. I am trying to figure out what parameters this developer used when used oracle 11g 11.2.0 on their machine. </p>
  
  <h2>Additional Details</h2>
  
  <p>There are at least 50 websites and most of them were written in visual studio 2008. So when I load the vs 2008 solutions, I need a way to connect to whatever servers they made for these websites (in order to debug a site). </p>
  
  <p>I need to make sure my local development environment allows me to debug. So I am talking about software installation of Oracle 11g. It is a client side installation. This is because I need a way for my client 11g to be able to connect to whatever servers they have developed.I do not have access to the local database on their machine that they created (and I believe that was only used for local development of websites. They called it client1, but I don't know how the username or password). </p>
  
  <h2>Edits</h2>
  
  <p>When I didn't have oracle 11g I got the following error:</p>
  
  <ol>
  <li><code>System.Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater</code></li>
  </ol>
  
  <p>So after installing the client, I then get the error: </p>
  
  <ol>
  <li><code>ORA-1254: TNS: could not resolve the connect identifier specified</code></li>
  </ol>
  
  <p>Here is code for the connection settings: </p>
  
  <pre><code>      public static DataSet ExecuteQuery(string sql)
          {
              OracleConnection oraConnection = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
              OracleCommand oraCommand = new OracleCommand(sql, oraConnection);
              oraConnection.Open();
  }
  </code></pre>
  
  <p>Here is the error message for the code above: </p>
  
  <p>Exception Details: System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified</p>
  
  <p>Source Error: </p>
  
  <pre><code>Line 391:            OracleConnection oraConnection = new OracleConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
  Line 392:            OracleCommand oraCommand = new OracleCommand(sql, oraConnection);
  Line 393:            oraConnection.Open();
  Line 394:
  Line 395:            OracleDataAdapter oraAdapter = new OracleDataAdapter(oraCommand);
  
  Source File: c:\projects\websiteNew\App_Code\CatalogDB.cs    Line: 393 
  
  Stack Trace: 
  
  
  [OracleException (0x80131938): ORA-12154: TNS:could not resolve the connect identifier specified
  ]
     System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc) +310694
     System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +683
     System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +133
     System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +40
     System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +29
     System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
     System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +72
     System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +457
     System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +100
     System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +116
     System.Data.OracleClient.OracleConnection.Open() +40
     Catalog.CatalogDB.ExecuteQuery(String sql) in c:\projects\websiteNew\App_Code\CatalogDB.cs:393
     Catalog.CatalogDB.GetCompanyInfo(String portal_id) in c:\projects\websiteNew\App_Code\CatalogDB.cs:367
     Global.CompanyInfo() in c:\projects\websiteNew\App_Code\Global.asax.cs:69
     Global.Session_Start(Object sender, EventArgs e) in c:\projects\websiteNew\App_Code\Global.asax.cs:55
     System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e) +8878884
     System.Web.SessionState.SessionStateModule.CompleteAcquireState() +237
     System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +504
     System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +66
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +155
  </code></pre>
  
  <p>Here is the connection string. I edited it to have fake names/passwords/etc for security: </p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;remove name="ConnectionString"/&gt;
      &lt;add name="ConnectionString" connectionString="Data Source=ZARDOZ;Persist Security Info=True;User ID=fake1;Password= f8k3r;Unicode=True" providerName="System.Data.OracleClient"/&gt;
      &lt;add name="ZARDOZPubsConnectionString" connectionString="Data Source=ZARDOZ-DB2.were.not.in.oz;Initial Catalog=COMM2000;Persist Security Info=True;User ID=fake2;Password=f8k3r" providerName="System.Data.SqlClient"/&gt;
      &lt;add name="ADConnectionString" connectionString="LDAP://were.not.in.oz/DC=were,DC=not,DC=in,DC=oz"/&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <h2>Edit</h2>
  
  <p>I have determined that the previous devs' are using tnsnames, put they were in ~/network/admin/ directory. I changed my *.ora files to look like theirs. I am now getting the following error: </p>
  
  <pre><code>ORA-12638: Credential retrieval failed
  </code></pre>
  
  <p>I will give upvotes to whoever comments and helps me fix this. I need to be able to debug code so that I can do my job, at the moment, I can't do that. :(</p>
  
  <p>Thanks, 
  GeekyOmega</p>