Two For each row in data table activities

you can check if the first loop can be avoided when using following statement:
dtUniqueIDs = dtOrig.DefaultView.ToTable(True, {"YourIDColName"})

So the second loop can iterate over dtUniqueIDs

sounds like a data grouping on ID

here the other statement should be cross-checked on possible side effects

when the update is placed on wrong dt1 rows, then maybe the dt1 unique ID logic is confused. We would recommend doing the first analysis by debugging and tracing the flow.

As mentioned by Raja, if possible share also some more details on sample data and implementation details with us.