在C#错误中运行SSIS包

时间:2017-03-28 04:28:33

标签: c# ssis

尝试在C#中运行SSIS包时出现此错误消息。错误是:

  

Microsoft.SqlServer.Dts.Runtime.TaskHost / SSIS.Pipeline中的错误:运行SSIS   在SQL Server数据工具之外的包必须安装Integration Services的Standard Edition或更高版本。

我检查了开发机器和服务器,两者都安装了SSDT。目标SQL Server是2012,我运行了一个报告来检查正在运行的Integration Services的版本,它是标准版(11.3.6020.0)。我注意到,当它运行实现某些派生列转换的数据流任务时会发生错误。有关如何解决此问题的任何想法?谢谢你的帮助!

这是我的C#代码:

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

class Program
{
    static void Main(string[] args)
    {
             GetExtractsData();            
    }


    static void GetExtractsData()
    {
        string pkgLocation;
        Package pkg;
        Application app;
        DTSExecResult pkgResults;
        MyEventListener eventListener = new MyEventListener();

        pkgLocation = @"C:\Package.dtsx";
        app = new Application();
        pkg = app.LoadPackage(pkgLocation, null);
        pkg.EnableConfigurations = true;
        Configuration config = pkg.Configurations.Add();

        config.ConfigurationType = DTSConfigurationType.ConfigFile;
        config.ConfigurationString=@"C:\Extracts_Config.dtsConfig";
        pkgResults = pkg.Execute(null, null, eventListener, null, null);

        Console.WriteLine(pkgResults.ToString());

        Console.WriteLine("The Extracts completed downloading at: " + DateTime.Now.ToString());
    }

0 个答案:

没有答案