I have created a SSIS package named “PackageA” withFor Loop container (“FLC”) in SSIS BIDS then saved asC:\ PackageA.dtsx.
My requirement is to add a Sequence container inside the For loop container programmatically.
I have added theSequence Container (“STOCKEQUENCE”) inside the For loop container programmatically with below mentioned code and saved the new package with name “PackageB” and saved asC:\ PackageB.dtsx.
Code:-
Application app =new Application();
string path =@"C:\ PackageA.dtsx";
Microsoft.SqlServer.Dts.Runtime.Package pkg = app.LoadPackage(path,null);
Executable exec = pkg.Executables["FLC"];
(exec as IDTSSequence).Executables.Add("STOCKEQUENCE");
app.SaveToXml(@"C:\ PackageB.dtsx", pkg,null);
Here the issue is…
In design view of “PackageB” I am not able to see the sequence container added programmatically, but it is visible in the Package explorer.
An idea on this? Is it something wrong in the code? Or need to add or refresh the containers?
Your inputs/suggestions are welcome. Thanks in advance!
Regards,
Umesh