I try to compare the two table by using linq query , here we check the dt1 contain the value of substring dt2 of two where dt1 and dt3 are datatable
this is the code:-
(
From a In dt1.AsEnumerable
From b In dt3.AsEnumerable
Let b = If (a(“Display Name”).ToString).Contains(b(“two_word”).ToString),Let a(“Status”) =“Match Found”,Let a(“Status”)=“Match Not Found”
Select a(“status”)
).CopyToDataTable
Hi @Shishir_Kumar ,
You can use a multiple assign where you create a temporary data table, then you can use my code and put the columns according to the data table named dt1.
Code:
(From x In DT_Aux
Let status = If ( dt3.AsEnumerable.Where(Function(y) x.item(“Display Name”).tostring.contains(y.item(“two_word”).tostring)).ToArray.COUNT>0,
“Match Found”,
“Match Not Found”)
Select dt1.Rows.Add(New Object(){x.item(0).tostring, x.item(1).tostring,x.item(2).tostring, status.ToString})).copytodatatable
Have a great day!
Please let me know if you need anything else.