How to get difference between two DataTables

前端 未结 8 881
自闭症患者
自闭症患者 2020-12-14 17:28

I have these two datatables and I want to get the difference between them. Here is an example:

Table1
-------------------------
ID  |   Name 
---------------         


        
8条回答
  •  攒了一身酷
    2020-12-14 18:20

    Try this

    DataTable dtmismatch = Table1.AsEnumerable().Except(Table2.AsEnumerable(), DataRowComparer.Default).CopyToDataTable();
    

提交回复
热议问题