I have a package i am using the foreach loop to loop through the databases. I am passing a string and it loops though all the databases. Everything is perfect till here.
The variable varbl
that you created only exists in the script context.
To increment the SSIS variable you need to do something like
public void Main()
{
int varbl = Convert.ToInt32(Dts.Variables["User::myvariable"].Value.ToString());
varbl++;
Dts.Variables["User::myvariable"].Value = varbl;
}
or the variable User::myvariable
will not be changed