I've populated a List in a script task with a custom class that has 3 properties.
I'd like to make the properties available to variables in a Foreach Loop Container in SSIS.
What c# datatypes are acceptable for the SSIS object variable? I haven't had much luck converting the list to an array (it works fine if I only use 1 property but fails as soon as I use two).
EDIT: If I populate an array like this:
string[] newArrayB = new string[] { "A1", "A2", "A3" };
I can then pass the array to an SSIS object variable and loop through it with a Foreach From Variable Enumerator. Mapping the 1 column to a SSIS string variable.
If I populate an array like this:
string[,] newArrayA = new string[3, 2] { { "A1", "Account A1" }, { "A2", "Account A2" }, { "A3", "Account A3" } };
I can then pass the the array to an SSIS object variable but can't loop through if I map the two columns to different SSIS string variables on index 0 and index 1. It just loops through each and every column as though it was one.
If I use an ADO Enumerator I get "Variable does not contain a valid data object".
My List originally comes from GetDirectories:
var folders = Directory.GetDirectories(FolderRoot).Where(d => Regex.IsMatch(Path.GetDirectoryName(d), "^[0-9]*")).ToList();
I then chop it out into the account number portion and and the rest of the folder name. I assumed I'd need to change a List to an Array to make it available to a Foreach.
"A", "Account A"is record 1,"B", "Account B"is record 2, etc. In foreach loop you can access as many fields into variables. Here is an example Foreach Loop. One question .. where are getting the data to populate your array (File/Database)?