title: C# Connecting to remote oracle database. ORA-12154 Could not resolve the connect identifier specified
body: <p>I have written an application which connects to an Oracle 10g database. From one computer it works fine but from another it errors. Neither computer is the database server.</p>
  
  <pre><code>ORA-12154: TNS:could not resolve the connect identifier specified
  </code></pre>
  
  <p>The connection string used:</p>
  
  <pre><code>private string = "provider=MSDAORA;Data Source=192.168.1.5/MyInstance;User Id=username;Password=password";
  private OleDbDataAdapter oda = oda = new OleDbDataAdapter();
  private OleDbConnection oracleConnection = new OleDbConnection(conString.ToString());
  </code></pre>
  
  <p>However the computer where it works is the database server for another oracle instance!</p>
  
  <p>My application needs to be able to connect to the oracle instance from any computer.</p>
  
  <p>Any ideas?</p>
  
  <p>EDIT: Ive tried this <a href="https://stackoverflow.com/questions/5076524/what-is-the-exact-format-of-a-connection-string-for-oracle">What is the exact format of a connection string for Oracle?</a> but couldnt get any of the options to work. </p>
  
  <p>EDIT: I found a connection string that works. </p>
  
  <pre><code>Provider=OraOLEDB.Oracle; Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.5)(PORT=1521)))(CONNECT_DATA=(SID=MyInstanceID)(SERVER=DEDICATED)));User Id = myusername; Password = mypassword;
  </code></pre>