When comparing DT1 and DT2, retrieve the matching rows Help

Hi @22222222asas

Try this query:

resultDataTable = (From row1 In DT1.AsEnumerable()
                                    Join row2 In DT2.AsEnumerable()
                                    On row1("NUMBER").ToString() Equals row2("NUMBER").ToString()
                                    Select row1).CopyToDataTable()

resultDataTable is of DataType System.Data.DataTable
If possible share the DT1 and DT2 data tables with dummy data.

Regards

1 Like