What you said about looping through the pds clicked after I made it output what it was doing.
I see what you’re saying now. The dataset isn’t what the foreach is looping through. The foreach is looping through the updated records of the temp table. So, I have to loop through the pds to find the right record and then I can update it.
For anyone else, here’s the train of thought that helped me understand the above a little more:
I wrote the index, before, and afters of all three to an out file and it all looks like I would expect:
Index: 0 - FROM: B | CON1 TO: B | BULK
Index: 1 - FROM: MAIN | WIP TO: MAIN | AA
Index: 2 - FROM: REMWH1 | TRK TO: REMWH1 | Staging
And if I run it for just the middle row:
Index: 0 - FROM: B | CON1 TO: MAIN | AA

The “FROM” is the pds.PartWhse[i] and the TO: is the ttResults table.
It clicked when I saw that the “FROM” data was the first record in the dataset and the TO was the updated record in the temp table.