Check Matched Rows of a Datatable in Sepefic Column and return result in True or false List of Boolean

I have a two data tables dt1 , dt2
I want to check for each row on one specific column in the two data tables are matching or not and return a Boolean value True for matching and false for unmatching and add them to a list of Boolean Type using linq query

Hi @Mohamed_Hassan1

Assuming the following as below

  1. the column u are looking in both datatables to compare is COL1

Now design ur below as per the below instructions

use assign activity to intialize a list of Boolean

list_1= New List(Of Boolean)

Now use the below linq query

list_1= (From r1 in dt1.AsEnumerable
From r2 in dt2.AsEnumerable
Select If(r1(“COL1”).ToString.Equals(r2(“COL1”).ToString),True,False)).ToList()

Try this

Nived N

let assume your request is about:
Check for a row from dt1 is there is any row in dt2 where dt1:row(“ColX”) = dt2:row(“ColX”)

give a try on following LINQ

(From d1 in dt1.AsEnumerable
Let chk = dt2.AsEnumerable.Any(Function (x) x(YourColNameOrIndex).toString.Trim.Equals(d1(YourColNameOrIndex).toString.Trim))
Select b=chk).toList

the count of returned booleans within the list = dt.Rows.Count, does mean:
for each dt1.Row = 1 check result Boolean