Delete Rows from a datatable after comparing with another datatable

Hi Champs,

It would be a great help if someone could guide me on my problem.
I have a datatable which consists of an IF condition and when that IF condition is true I want to match this datatable rows with the main table and then want to remove these rows .
Any leads will be very Helpful.

Thanks!!

1 Like

Instead we can get the records we want from the second table alone that too the matching records alone, with JOIN DATATABLE activity having left join
Cheers @Shikhar_Tandon

Thanks for the reply @Palaniyappan , Actually the main table consists of all the records. I Took some records manipulated them and then my work is finish so i want to remove that records or rows from the main table and then want to print the updated main table somewhere else.Can join help in this case ?

Fine got it,
Did we try with linq query like this once after getting the datatable from both the excel files

dt_NonMatched_Data = In_DataTable1.AsEnumerable().Where(function(row) Not In_DataTable2.AsEnumerable().Select(function® 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()

Cheers @Shikhar_Tandon

2 Likes