I have populated a list in C# script and assigned its value to SSIS object variable.
Then I used that object variable to execute some SQL query by looping through For each do enumerator.
I tried doing this by Foreach ado enumerator but getting error
X variable doesn't contain a valid data object.
Can anybody provide any inputs.
Youre using a list. Not a recordset and therefore you need to enumerate over a variable.
If you want to use ADO Recordset, you need to fill a datatable instead.
Like this:
1 .C# Script code - Write to Object with list using variable enumerator
1. Variable settings in ssis
1. Foreach loop container settings
1. Execute SQL Task test case
1. Result
2. C# Script code - Write to object with datatable using ADO enumerator
2. Variable settings in ssis
2. Foreach loop container settings
2. Execute sql task test case
2. Result
Thanks @plaidDK Second approch solved my problem
2.C# Script code - Write to object with datatable using ADO enumerator
Instead of list I have populated data table:
//Variable passed as below Variables.vFailedTransactionNo = dt;
ANd then ado enumerator done rest of the job.
Thanks for help!