title: Unity Oracle connection DllNotFoundException: oci
body: <p>So basically I was trying to access an Oracle database within unity and mono-develop. I copied the needed DLLs System.Data and System.Data.OracleClient
  from under: C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\2.0 
  to the Project's Assets folder,</p>
  
  <p>Here's my C# code:</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  using System.Data;
  using System.Data.OracleClient;
  
  
  public class OracleConn : MonoBehaviour
  {
  
      public string connectStr = "SomeConnectionString";
      string TBName = "CZRK";
      List&lt;string&gt; listOfID = new List&lt;string&gt;();                       //ID
      List&lt;string&gt; listOfName = new List&lt;string&gt;();                     //NAME
  
      private string content;
  
  
      void Start()
      {
          OracleConnection conn = new OracleConnection(connectStr);
  
          conn.Open(); //the line that causes error
  
      }
  
  }
  </code></pre>
  
  <p>then the error DllNotFoundException: oci pops out when executing conn.Open() </p>
  
  <p>the full error log:</p>
  
  <pre><code>DllNotFoundException: oci
  System.Data.OracleClient.Oci.OciCalls.OCIEnvCreate (System.IntPtr&amp; envhpp, OciEnvironmentMode mode, IntPtr ctxp, IntPtr malocfp, IntPtr ralocfp, IntPtr mfreep, Int32 xtramem_sz, IntPtr usrmempp)
  System.Data.OracleClient.Oci.OciEnvironmentHandle..ctor (OciEnvironmentMode mode)
  System.Data.OracleClient.Oci.OciGlue.CreateConnection (OracleConnectionInfo conInfo)
  System.Data.OracleClient.OracleConnectionPoolManager.CreateConnection (OracleConnectionInfo info)
  System.Data.OracleClient.OracleConnectionPool.CreateConnection ()
  System.Data.OracleClient.OracleConnectionPool.GetConnection ()
  System.Data.OracleClient.OracleConnection.Open ()
  (wrapper remoting-invoke-with-check) System.Data.OracleClient.OracleConnection:Open ()
  OracleConn.Start () (at Assets/OracleConn.cs:25)
  </code></pre>
  
  <p>Besides, I also tried copy the DLL file oci.dll from oracleDB_11g into the assets folder, but problem remains, any ideas??</p>