How to compare two tables if they are exactly the same

Hello.
I need to compare 2 tables. They must be exactly the same or else I have to add an exception. How to check if they are exactly the same?

1 Like

Hey @Techpriest ,
I remember that I had a similar task to do. They I used one expression:

dt1.AsEnumerable().Except(dt2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable

Only if there is a difference between the tables will be returned value.

Take an example:
BlankProcess31.zip (2.6 KB)

2 Likes

Hello @Techpriest I would like to help you.

Just one question, Do you need to know wich row or cell does not march or just validate if tables are equals?

@Techpriest

Check below link for your reference

Hope this may help you

Thanks

1 Like

Ok. I will check your suggestions. Thanks.

@pikorpa it was smart solution and it helped me. Thanks.

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