我尝试使用 C# 为脚本组件中的变量赋值,但无法这样做。任何人都可以发布代码或告诉我下面出了什么问题。
public override void PostExecute()
base.PostExecute();
IDTSVariables100 varCollection = null;
this.VariableDispenser.LockForWrite("User::Variable");
this.VariableDispenser.GetVariables(out varCollection);
varCollection["User::Variable"].Value = @"TESTING";
MessageBox.Show(Variables.MerchOrgName.ToString());
这个例子非常全面。大多数时候,这两种方法中更简单的一个就足够了 - 特别是如果您刚刚开始。
http://microsoft-ssis.blogspot.com/2011/01/how-to-use-variables-in-script.html