DataTable result compare

I used Table extraction get two datatable, may I know if we need to save datatable to excel to compare or any activity able to compare directly?


You can compare two datatable using below code

dtOutput = dt1.AsEnumerable().Except(dt2.AsEnumerable(), DataRowComparer.Default);

In dtOutput if found any count then there is difference


1 Like

Hello @372402124

You can directly compare the 2 datatables and get the similar and dissimilar rows.


i try with this way and got error message

is it because data not from row2? this is a report which had a 2 rows title here

This is happening as the columns are having the same names. Datatable should not have the same named columns.


i went through the columns name for the report, looks like no two columns had totally same name, how to identify where it throw error?

This working well to get total different number

can you search with 2442 and see whether that value is there in the excel?


Yes, Rahu, i search 2442 and there are 3 cell had this value, but that is data only, not column name

Can you please share the screenshot of Read range activity which you are using? Also, have you enabled the Is Header option?


Yes, Rahul, i enabled Is_header option,pls refer to my read range activity and excel format

can you provide the range as well. In your excel first cell is blank and the range should start from A2.

Else first remove the first row in the sheet, then use read range activity.


try with start A2, got read range output datatable as this

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