亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

從外部應用程序執行具有腳本組件的SSIS 2012程序包

從外部應用程序執行具有腳本組件的SSIS 2012程序包

C#
aluckdog 2019-11-04 13:07:39
我正在編寫一個應用程序,它將使用Microsoft.SqlServer.ManagedDTS v 11.0程序集執行SSIS 2012程序包。我要執行的程序包是從SSDT-2012設計并成功執行的,并且具有處理無法正確傳輸的行的腳本組件。當我嘗試運行我的應用程序時,我收到每個腳本組件的錯誤消息:SSIS.Pipeline:要在SQL Server數據工具之外運行SSIS包,必須安裝Integration Services或更高版本的[腳本組件名稱]。配置:使用以下app.config文件在Windows上為x86構建應用程序:<?xml version="1.0" encoding="utf-8" ?><configuration>    <startup useLegacyV2RuntimeActivationPolicy="true">        <supportedRuntime version="v4.0"/>        <supportedRuntime version="v2.0.50727"/>    </startup></configuration>唯一相關的代碼是:using System;using System.Data;using System.Data.Common;using System.IO;using Microsoft.SqlServer.Dts.Runtime;class MyApp{    public void ExecutePackage()    {        //Assume I have all the variables I need like packageFile, packageName,         //srcConnectionString, destConnectionString and eventListener etc.        Package pkg;        Application app;        DTSExecResults pkgResults;        app = new Application();        pkg = app.LoadPackage(packageFile, eventListener);        pkg.Variables["SrcConnectionString"].Value = srcConnectionString;        pkg.Variables["DestConnectionString"].Value = destConnectionString;        if (null != srcAssembly || null != destAssembly)        {            foreach (ConnectionManager connection in pkg.Connections)            {                if (null != srcAssembly && connection.Name.Contains("Source"))                {                    connection.SetQualifier(srcAssembly);                }                else if (null != destAssembly && connection.Name.Contains("Destination"))                {                    connection.SetQualifier(destAssembly);                }            }        }        pkgResults = pkg.Execute(null, null, eventListener, null, null);    } }有任何想法嗎?
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 463 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號