In my project i’m doing comparison of two data tables. Comparing DT2 with DT1. If there are any unmatched rows the rows in DT1 in comparison with DT2, The rows are added to an existing workbook. Everything is running good . But the case here is if there are NO unmatched rows the ROBOT is coming out of the process. The comparison code is in the try catch. I can see error message in the output window. I’m using below code for comparison.
DT1.AsEnumerable().Where(function(row) Not DT2.AsEnumerable().Select(function(r) r.Field(Of String)(In_DT2_ColName_To_Match.ToString)).Any(function(x) x = row.Field(Of String)(In_DT1_ColName_To_Match.ToString))).CopyToDataTable()
in the above code remove the CopyToDataTable() function in end.
then you will get the Array of DataRows
then use if condition like the length of the above statement is > 0 convert to DataTable else skip