divya_Bhat
(divya Bhat)
1
Hi All,
I have 2 datatable
DT1 :
Name Role
AAA IT
BBB Customer Executive
DT2 :
Name Role
AAA IT
CCC Admin
BBB Customer Executive
I need to retrieve matching records
Final result :
Name Role
AAA IT
BBB Customer Executive
Hi @divya_Bhat , firstly welcome!.
After reading your question, here is the code. Use Intersect it will get the require common rows

dt1.AsEnumerable().Intersect(dt2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable
2 Likes
divya_Bhat
(divya Bhat)
3
@pavithra_pavi for quick help!, i was in need of urgent help. Code works !!!

1 Like
@divya_Bhat , happy to help!
system
(system)
Closed
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.