Reputation: 141
I am trying to assgin a value to a variable in script component using C# but unable to do so. Can anyone please post the code or tell me what wrong below.
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());
Upvotes: 0
Views: 8492
Reputation: 1505
This example is very comprehensive. Most of the time the easier of the two methods is sufficient - especially if you are just starting.
http://microsoft-ssis.blogspot.com/2011/01/how-to-use-variables-in-script.html
Upvotes: 0