title: How to connect to oracle using Oracle.ManagedDataAccess
body: <p>I am trying to connect to oracle data base using below code.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data;
  
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using Oracle.ManagedDataAccess.Client;
  using Oracle.ManagedDataAccess.Types;
  
  namespace ConsoleApplication2
  {
      class Program
      {
          static void Main(string[] args)
          {
  
              string connectionString =
                  "Data Source=a;User Id=id;Password=pwd;";
  
              OracleConnection con = new OracleConnection(connectionString);
              con.Open();
              Console.WriteLine("Connected to Oracle Database {0}", con.ServerVersion);
              con.Dispose();
  
              Console.WriteLine("Press RETURN to exit.");
              Console.ReadLine();
  
          }
  
      }
  }
  </code></pre>
  
  <blockquote>
    <p>Its throwing exception saying:</p>
    
    <p>An unhandled exception of type
    'Oracle.ManagedDataAccess.Client.OracleException' occurred in
    Oracle.ManagedDataAccess.dll</p>
    
    <p>Additional information: ORA-12514: TNS:listener does not currently
    know of service requested in connect descriptor.</p>
  </blockquote>
  
  <p>Can any body correct me what was going wrong with the above code?</p>