Removing duplicate row in datarowcompare

Dt1.Asenumerable().Except(dt2 .Asenumerable().DataRowCompare.Default).copytodatable

My dt1:
Name. Id. Qty
App. 1. 1
Bt. 2. 3
App. 1. 1
Tea. 5. 4

Dt2
Name. Id. Qty
Bt. 2. 3
My output
Name. Id. Qty
App. 1. 1
Tea. 5. 4

It also removing same row(App. 1. 1) while comparing .please help me out

@brindhaS Can you show us what is the Output that you get and what is the Output that you Expect ?

Ok my output should be im expecting
After in removing
Name. Id. Qty
App. 1. 1
App. 1. 1
Tea. 5. 4

@supermanPunch can you have a look I’ve displayed what my expected output

@brindhaS What if the dt2 contains some other data which is not present in dt1 ?

Row 2 is matching so that 1st query removes it

@brindhaS Yes. I understood that :sweat_smile: but what if your data is something like this, then what is the Output you expect ?

dt1 :
Name. Id. Qty
App. 1. 1
Bt. 2. 3
App. 1. 1
Tea. 5. 4

Dt2 :
Name. Id. Qty
Bt. 2. 3
Ct. 1. 4.

@brindhaS
Have a Look Here.

Maybe you will Just extend to the Second column but running with the Same logic

1 Like