dbTalk Databases Forums  

Custom .Net Tasks and Global Variables

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Custom .Net Tasks and Global Variables in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Wright
 
Posts: n/a

Default Custom .Net Tasks and Global Variables - 02-13-2004 , 10:21 AM






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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.