如何在C#中将值传递给SSIS包? [英] How to Pass a value to SSIS package in C#?
本文介绍了如何在C#中将值传递给SSIS包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个源表
I have this source table
Employee(ID, Name)
我有这个目的地表
I have this Destination Table
EmployeeImported(ID,Name,DesgnationID)
在转换过程中,我想从C#插入DesignationID。我在dataflowtask中添加了一个参数。我比较新我不知道我该怎么做。但是我在数据流任务中定义了一个参数。请指导我。
During transformation I want to Insert DesignationID from C#. I add a parameter in dataflowtask. I'm Newer I don't Know how do I do this. However I have defined a parameter in data flow task. Kindly guide me.
推荐答案
试试这个,
Try this one,
package = null;
package = app.LoadPackage(@"C:\ft\Package.dtsx", null);
package.Variables["User::varParam"].Value = "param value";
您需要在ssis中创建包级别变量在ssis中使用该变量来选择它的值。
现在来自c#你可以设置这个全局参数的值,它将被传递给你的方法。
希望这会有所帮助
问候,
Mubin
Hi,
You need to create package level variable in ssis and use that variable within ssis to pick its value.
now from c# you can set value of this global parameter and it will be passed to your method.
Hope this will help
Regards,
Mubin
>
这篇关于如何在C#中将值传递给SSIS包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文