Using Linq compare two datatable and return result to 3rd datatable

I making a process to compare each item in two datatable. I using for each datatable, but it take very long time. I refer some linq code to speed up, but its not work. Could you please help me!

Datatable 1
A B C…
X Y Z…

Datatable 2

A X C…
A B Z…

Return result to Datatable like this.
T: when same
F: when different

T F T…
F F T…

Help me Please!

Hi,

How about the following?

dtResult = dt1.AsEnumerable.Zip(dt2.AsEnumerable,Function(r1,r2) dt1.Clone.LoadDataRow(r1.ItemArray.Zip(r2.ItemArray,Function(v1,v2) if(v1.ToString=v2.ToString,"T","F")).ToArray,False)).CopyToDataTable()

Sample20220702-2.zip (2.9 KB)

Regards,