Update Column By Comparing two datatables using Linq Query?

Let say I have 3 columns in first datatable and 4 columns in second datatable.
Now I have my conditions - check Col1 of First datatable Not equals Col1 of second datatable
and one more condition - check Col2 of First datatable Equals Col2 of second datatable.
If above conditions satisifies then
Then only Update the Col4 of Second datatable as “Not Matched”…(Using Linq Query)
If any one finds the solution reply me with the solution as soon as possible???..

Updating Cols with LINQ is a little bit stressing the Query Concept of LINQ. However often the combinations between LINQ Queries and for each (Activity or List method) were successfully.

I can have a look on this, but please provide me some sample data as Excel. This allows me to work out faster a suggestion. A first crosscheck on the LINQ API gave some hints. It seems to me that it is possible

1 Like

Hi @Manish540

Check this

ashwin S

1 Like

I did an implementation:
Task 1: find the not matching rows
Task 2: Update these rows with No Match information

PFA xaml here: Manish540.xaml (7.4 KB)
PFA used Excel here: Manish540.xlsx (9.3 KB)

I suggest to keep the split due maintenace and controlled complexity reasons.
Combining all into one would result into an unmanageable piece of statement, is going against the LINQ concept and do start focusing more tricky things (e.g. my “silly trick approach”) and not on real task.

Let me know your feedback and flag the solving post as solution. So others can benefit from it


I’m not getting the output as you mentioned in your screenshot???..
and it’s also not there in the workflow???..

OK you have Downloaded both:
xaml, Excel
from Post above, and maybe rewired the path to the excel, right?

Yes, I have downloaded the both of them.

Better Help WE can give once you Share more Details on what you have done so far, which excact Data you have send into the Processing, which issues occur etc.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.