Problem => The value passed to SSIS variable from C# code is not picked up by SSIS. I have an SSIS pkg, which use user defined variable x of type int, with default value of 3. When executing the pkg from C# and assigning value 7 to x. The SSIS pkg not picking the new value for x and using value 3.
Code =>
string pkgLocation = @"D:\DCS\Narendra\Min Extract\MinExtract Solution\MinExtract Project\test.dtsx";Package pkg;
Application app;
DTSExecResult pkgResults;
Variables vars;
app = new Application();
pkg = app.LoadPackage(pkgLocation, null);
vars = pkg.Variables;
vars["UptoSeries"].Value = 7;
pkgResults = pkg.Execute(null, vars, null, null, null);
if (pkgResults == DTSExecResult.Success)
Console.WriteLine("Package ran successfully");
else
Console.WriteLine("Package failed");