I use VB where I see you are using c# so it may be different butI I thought I would share my VB expeirence. In the control flow dts.variable works fine and I was ablt to call the variable with no problem. however in data flow task I had to do something quiet different. I had to us
Me.VariableDispenser as I said this may or may not be the case in c# but that worked for me in VB. I also had to lock the variable in the preexecute and the save that value to an internale value to be used during the rest of the processing. So in this example I am just reading the value of a previously read value and incrementing by one and then writting out to a row. Hope this helps you.
Public Class ScriptMain
Inherits UserComponent
Dim MaxRes As Integer
Public Overrides Sub PreExecute()
Dim var As IDTSVariables90
Me.VariableDispenser.LockOneForRead("MAXRESER", var)
MaxRes = CType(var("MAXRESER").Value, Integer)
MaxRes = MaxRes + 1
var.Unlock()
MyBase.PreExecute()
End Sub
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Row.PERSONSTATUSID = MaxRes
MaxRes = Maxres + 1
End Sub
End Class
Dan
If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.