How to delete the row from datatable2 which has different value from datatable1

@shailesh1920 ,

Could you try the below Steps :

  1. Read the above sheet’s First Column using Read Column Activity. Assuming that the Service Number will always start from that specific position (A2). The Output will be a collection which will contain all the service numbers present in the column, let the output variable be named as serviceNoList.

  2. Next, Read the below Sheet using Read Range Activity. Get the Output as Datatable, say DT.

  3. Next, Use an Assign Activity and use a Linq Query to Filter only the rows which contains the Service numbers present in the above sheet.

DT = DT.AsEnumerable.Where(Function(x)serviceNoList.Any(Function(y)y.ToString.Trim.Equals(x("Service No").ToString.Trim))).CopyToDatatable
  1. After the Filtering, The DT variable should contain only the rows that has the service numbers which match the service numbers in the above sheet. We could then Write this datatable value to a new sheet using Write Range Activity.

To handle the Errors on Direct CopyToDatatable you could check the below post :

Let us know if you are still facing issues.