c# - difference between 2 datatables -


I have two figures DataTable dtRequired and DataTable dtResult.

I want to output a dataset which contains rows which were not present in dtResponse but were found in dtRequired.

Approach 1 We are using the algorithm specified on the following URL.

Approach 2 So, I tried to replace the ala given above with some of the following things. DtRequired has been indexed on columns that use the Find line below I .

  if (dtResult.Rows.Count> 0) {lock (dtResult) {DataRow row = null; For (int i = 0; i  

However, the above piece is taking longer than the time taken by approach 1 approach 2 to 1250 With dots for dtResult takes DTRAEFair with 3 seconds and 4500 rows.

Am I wrong with the above mentioned approach? Is there any better way to achieve this?

This is an MSDN page that uses datasets from LINQ to get the rows appearing in both the figures To use this example hide I think that you can modify it by using except instead. I do not know if performance will improve or not.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -