Im trying to filter through two datatables and find any matches were the column A (name) is the same between the two datatables.
- I have a large datatable (dt1) that containes a list of customer names and the value
- I run a report and extract that data into another datatable (dt2)
- If the Name from dt2 = the name from dt1. Then we update dt1 with the value from dt2
- If the Name from dt2 <> the name from dt1. Then we add a new row to the datatable (dt3).
Right now i have a build datatable (dt3) at the top of my sequence. I use that datatable (dt3) to store the data from conditional. I have a foreach that loops through dt1 and then another foreach inside the 1st foreach that loops through dt2. My if condition is inside the 2nd foreach loop.
The issue im having it that im gettting duplicate rows inside dt3. I think its from having a nested foreach, but im not sure how to fulfill my requirements without it. Any ideas on how to resolve this?