Hi
I am trying to write a custom task in c#. One of the functions of the task is to update the global variables of the package from a list stored in XML file at execution time.
The problem I am having is getting the .Net code to change the value of global variable (i.e. CurrGlobalVar.Value = “TestValue”

. I have seen some code on the net (http://www.sqldts.com/default.aspx?265) where they change the value of the global variable by removing and re-adding with the new value (i.e. CurrGlobalVars.Remove(“TestVar”); CurrGlobalVars.AddGlobalVariable (“TestVar”,”NewTestValue”)

. But my problem with this is that when running in the designer the all the global variables that were changed stay deleted, so the next I run the package in the designer the task does not work because there are no global variables to update. Does anyone have a work around I need my task to run able through the designer and I need to keep the global variables
In summary, when executing the task via DTS Designer the global variables are dropped and recreated but only exist for the duration of the package execution and are not persistent. Any ideas
Thank