且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何比较数据表和数据之间的值数据集?

更新时间:2023-12-01 10:10:04

DataSet有Datatables,你可以将这些数据表与其他数据表进行比较。
DataSet has Datatables, you can compare those datatables with some other datatable.


A DataSet DataTable $ c $的超集C>。一个数据集可以有多个 DataTable 。您需要找出哪个DataTable(在您的SQL结果集中,如果您有多个查询结果),您想要与您所讨论的DataTable进行比较。



然后你可以使用Linq来查找差异,使用之外。检查下面的链接,它提供了一个很好的例子,说明如何做到这一点:

使用LINQ比较数据集 [ ^ ]
A DataSet is superset of DataTable. One Dataset can have more than one DataTable. You need to find out which DataTable(in your SQL result set if you have more than one results of your query) you want to compare with the DataTable you have in question.

And then you can use Linq to find the differences by using Except. Check the link below it provides a good example on how you can do that:
Comparing DataSets using LINQ[^]


你好,

是的。您可以在Linq中使用 Except 函数来比较Abhipal建议的两个DataTable之间的差异。查看此链接以供参考:

比较两个Linq的DataTables



谢谢
Hello ,
Yes . You can use Except function in Linq to compare the difference between two DataTables which also suggested by Abhipal. Check this link for reference :
Compare two DataTables by Linq

thanks