How to Compare 2 data tables using LINQ ? RRS feed

  • Question

  • I have 2 datatables with 10 columns each with same datatypes with no primary key -

    Dim oldEmployeeDetails As DataTable
    Dim newEmployeeDetails As DataTable

    I just want to know if the data in these 2 datatables is identical or changed. I don't want the actual differences, just want True or False i.e. is the data change exists or not ?

    I can do it with 2 loops - one on each row and inside it loop on each column and based on the row order data for each cell will be compared.

    But, I want to know if there is any faster way using LINQ to check if the data is changed or not ?

    • Edited by Harsh1 Saturday, June 22, 2013 9:13 AM
    Saturday, June 22, 2013 9:03 AM