Fascinating.
I added in the loop a ShowMessage("Hello There")
And it looped three times.
I commented out the ShowMessage
It didn't loop at all
I
think what must be happening is this:
From the docco on ImportRow
"
If the DataRow that is passed as a parameter is in a detached state, it is ignored, and no exception is thrown.
"
On inspection, all but the first row are in a detached state.
So, somehow, at runtime, it doesn't even iterate the rest of the collection because it doesn't need to.
This is absolutely fascinating if this is really the case -can the runtime really choose not to execute a loop in these circumstances?
Surely not?