title: Optimize looping through large datatable
body: <p>I'm loping datatable with 100 to 10000 rows, comparing each row to each other through doyble loop.</p>
  
  <pre><code>for (int i = 0; i &lt; DT1.Rows.Count; i++)
  {
      for (int j = 0; j &lt; DT1.Rows.Count; j++)
      {
          //some code to compare data
      }
  }
  </code></pre>
  
  <p>For 100-200 rows it's done in few minutes, which is OK, but comparing few thousands rows to few thousands, takes hours and isn't finished.</p>
  
  <p>What can I do to speed it up? Best I thought up is to use lists of objects, instead of datatables.</p>
  
  <p>Any other sugestions?</p>
  
  <p>Can thread be used to do this?</p>
  
  <p>Thanks.</p>