The thing is I have more columns on data table but I just want to compare 2 like you did. So I believe the solution you gave will compara all columns. How can I compare only the doc.num and item column? Or can I?
To give you a better understanding remove excel only has doc.num. and item column
main excel has doc. num, item and 8 more columns. I appreciate your help very much.
Kindly note: the demo set is working with a reduced sample dataset (3 cols instead of 8). But the main thing is the check on the 2 key columns and this is implemented. Just adopt it to your needs and Columnnames/index.
@jntrk
in the case we want to get back a datatable (while filtering with DatatableVar.Select(…, or a LINQ) we can use CopyToDataTable. But in case of empty results the CopyToDataTable throws an exception,
The Pattern above is denfensive as it returns a list of DataRows (from LINQ result) and if there are Datatrows returned then it executes the CopyToDataTable. Otherwise it clones the origin datatable and creates with this an empty datatable with the same structure.
Fell free to do your further testing. Once it hass passed the test just close the topic with marking the solving paost as solution