Hi All, I am looping two data tables, In second data table I am using if condition my issue is i want to pass if condition data by using argument CURRENTROW1(“A”).ToString.Equals(CurrentRow2(“A”).ToString) And
CURRENTROW1(“B”).ToString.Equals(CURRENTROW2(“B”).ToString)
Note-I want to pass entire data via args not columns names
Let’s assume your two DataTables are dt1 and dt2, you can retrieve the rows of the second DataTable along with the filter using this LINQ statement:
dt2.AsEnumerable.Select(Function(CurrentRow2) dt1.AsEnumerable.Where(Function(CurrentRow1) CurrentRow1("A").ToString.Equals(CurrentRow2("A").ToString) And CurrentRow1("B").ToString.Equals(CurrentRow2("B").ToString)))