Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi friends,

hope all fine,

need your idea little urgent,

Actually i have datatable with values, also i have dataset with values from my SP.

Now i want to compare both datatable & dataset, for the purpose need to show what are the records don't have(i think need to check row by row).


Thanks
Best Regards
G.Renga
Posted

DataSet has Datatables, you can compare those datatables with some other datatable.
 
Share this answer
 
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[^]
 
Share this answer
 
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900