C#: Iterating through a huge datatable

Apr 24 2013 11:34 AM
I have 2 data-tables which i need to compare and get the result in different table.Almost i am comparing 1000 records and it takes 2 minutes for doing comparison and get the result.I am using for loop.

Is there any other way i can optimize the for loop and reduce the processing time.

Ex : for (int i = 0; i < dt1.Rows.Count; i++)
      {
         for (int j = 0; j < _dt2.Count; j++)
        {
           //Process
        }

      }


Answers (11)