Sunday, February 19, 2012

For Each Loop Oddities

I am experiencing some odd behavior in the Foreach Loop Container and was wondering if anyone else has experienced this. I have a SQL statement from a staging environment that populates an ADO recordset. When I created the variables in the package I specified them as the types that I was expecting (1 Int64 and the rest as strings). However, I kept getting a type cast error when it tried to run through the loop, this error only came about on the Integer column, which I believe was due to it being the first column. The only way I was able to resolve the problem was to set each variable type to DBNull after that it made it entirely through the loop. Has anyone else experienced this? Is this normal? Thanks for your assistance.

-Krusty

PS: All columns could be null with the exception of the ID/Int64 column.

To debug the problem please set a breakpoint and when breaks into debugger see what real been used.

No comments:

Post a Comment