Nested For Each Row In a datatable

Hii,
I have two Datatables : Dt1 and Dt2
I wanted to search the column values of Dt1 into Dt2
Q1. So which Datatable will be in an outer loop and which one will be in an inner loop?

And, in if statement i will use Datatable.Item(ColumnName).ToString().Contains(Datatable.Item(ColumnName).ToString())

Q2. Which Datatable will be inside Contains method?

Hi @Doonline

Put the Dt1 in outer for each loop and Dt2 in inner loop

In the if condition put it like. Dt1.Item("Column name).ToString.Contains(Dt2.Item(“Column name”).ToString)

Hope it solves your issue

Thanks
Robin

Okay Thank You

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