title: Can't connect to Oracle through SSIS Script Task
body: <p>I am trying to connect oracle server by C# in SSIS script task and run some select/insert queries there. But even I added Oracle.DataAccess.dll, it is still failing because of assembly issue. BTW, Execute sql task can connect to oracle server with same connection string. Here is code that i use for connect:</p>
  <pre><code>class Ora
  {
      OracleConnection con;
      public void Connect()
      {
          con = new OracleConnection();
          con.ConnectionString = &quot;Data Source=ServerName;User ID=UserID;Provider=OraOLEDB.Oracle.1;Persist Security Info=True;Password=pass&quot;;
          con.Open();
          Console.WriteLine(&quot;Connected to Oracle&quot; + con.ServerVersion);
      }
  
      public void Close()
      {
          con.Close();
          con.Dispose();
      }
  
  }
  public void Main()
      {
          // TODO: Add your code here
          Ora ot = new Ora();
          ot.Connect();
          ot.Close();
          Dts.TaskResult = (int)ScriptResults.Success;
      }
  </code></pre>
  <p>And I am getting below error:</p>
  <blockquote>
  <p>An exception of type 'System.IO.FileNotFoundException' occurred in ST_c321d7d567aa46c7bad48f7f0d92bed5 but was not handled in user code</p>
  <p>Additional information: Could not load file or assembly 'Oracle.DataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified.</p>
  </blockquote>