Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Calling package from C# fails with bad OleDbConnection

$
0
0

I have a VS2012 solution with a number of projects, one of which is based on SSIS.

The package reads in a CSV flat file, filters it, clears a SQL Server 2008 table and then loads the CSV file into that table. The environment is Windows 7 x64. The SQL Server instance is not on the local machine.

When I execute the package directly in Visual Studio, it completes successfully. However, when I call it programmatically, it fails. I do not know what to try next. My hunch is that there's something weird with the password. 

I would appreciate any suggestions - Thanks

Code calling package:      

      private static void importToDatabase(string fullPath)
      {
         MyEventListener listener = new MyEventListener();
         Application app = new Application();
         Package package = app.LoadPackage("package.dtsx", listener);
         DTSExecResult pkgResults = package.Execute(null, null, listener, null, null);
         Console.WriteLine("Package results: {0}", pkgResults);
      }
   }

   class MyEventListener : DefaultEvents
   {
      public override bool OnError(DtsObject source, int errorCode, string subComponent,
        string description, string helpFile, int helpContext, string idofInterfaceWithError)
      {
         Console.WriteLine("Error in {0}/{1} : {2}", source, subComponent, description);
         return false;
      }
   } 


Error message from MyEventListener:
Error in Microsoft.SqlServer.Dts.Runtime.TaskHost/SSIS.Pipeline : Cannot find the connection manager with ID "{C25724AB-D25F-48EB-B821-0D24E2E9FB98}" in the connection manager collection due to error code 0xC0010009. That connection manager is needed by "OLE DB Destination.Connections[OleDbConnection]" in the connection manager collection of "OLE DB Destination". Verify that a connection manager in the connection manager collection, Connections, has been created with that ID.


From package.dtsx:
              <connections>
                <connection
                  refId="Package\Import Data\OLE DB Destination.Connections[OleDbConnection]"
                  connectionManagerID="{C25724AB-D25F-48EB-B821-0D24E2E9FB98}:external"
                  connectionManagerRefId="Project.ConnectionManagers[ZEBAY.Mail.pow]"
                  description="The OLE DB runtime connection used to access the database."
                  name="OleDbConnection" />
              </connections>

From ZEBAY.Mail.pow.conmgr:    
<?xml version="1.0"?>
<DTS:ConnectionManager xmlns:DTS="www.microsoft.com/SqlServer/Dts"
  DTS:ObjectName="ZEBAY.Mail.pow"
  DTS:DTSID="{C25724AB-D25F-48EB-B821-0D24E2E9FB98}"
  DTS:CreationName="OLEDB">
  <DTS:ObjectData>
    <DTS:ConnectionManager
      DTS:ConnectionString="Data Source=ZEBAY;User ID=pow;Initial Catalog=Mail;Provider=SQLNCLI11.1;Persist Security Info=True;Auto Translate=False;">
      <DTS:Password
        DTS:Name="Password"
        Sensitive="1">AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAhI0KfBwx2EK6eU0KGMzzJwAAAAACAAAAAAAQZgAAAAEAACAAAABmoDqlG38/fl0EmUKR4SibW+9bIlEG4ZkrpIUBJG8yNgAAAAAOgAAAAAIAACAAAABGugaTuSIDMg2k4l4v8bu6OnhCjvsiVf+BJp80OvHN5IAAAADzq/Ht1y50sNtTeqYG/sj3YHGR+0q5Q/bTusEE5yzGjurzBNFuE230QspL+8hXlrqc+9+Wcqp1x/PFeMuinT5YjCD15iOw62gF2/xh8FKwK5v1IU09jNpvVjzphE6gxlze+pxkLf0n9xZHda7rjee5gcrnaEpEX1Za7WzyaNrfXEAAAAAXtvrXxoXugYmFEqRrDe1VCpsxyUT5vwBCHXp9oGUIyhn9amfyhdoJ6NG4ZjUsbp88/+qRTFNii2WmiyO2/MXC</DTS:Password>
    </DTS:ConnectionManager>
  </DTS:ObjectData>
</DTS:ConnectionManager>

              

Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>