title: Loop Running VERY Slow
body: <p>please help me make my app a little faster, it's taking forever to loop through and give me results right now.</p>
  
  <p>here is what im donig:
  1. load gridview from an uploaded excel file (this would probably be about 300 records or so)
  2. compare manufacturer, model and serial No to my MS SQL database (about 20K records) to see if there is a match.</p>
  
  <pre><code>'find source ID based on make/model/serial No combination.
          Dim cSource As New clsSource()
          Dim ds As DataSet = cSource.GetSources()
          Dim found As Boolean = False
  
          'populate db datatables
          Dim dt As DataTable = ds.Tables(0)
          Dim rows As Integer = gwResults.Rows.Count()
          For Each row As GridViewRow In gwResults.Rows
              'move through rows and check data in each row against the dataset
              '1 - make
              For Each dataRow As DataRow In dt.Rows
                  found = False
                  If dataRow("manufacturerName") = row.Cells(1).Text Then
                      If dataRow("modelName") = row.Cells(2).Text Then
                          If dataRow("serialNo") = row.Cells(3).Text Then
                              found = True
                          End If
                      End If
                  End If
  
                  'display results
                  If found Then
                      lblResults.Text += row.Cells(1).Text &amp; "/" &amp; row.Cells(2).Text &amp; "/" &amp; row.Cells(3).Text &amp; " found"
                  Else
                      lblResults.Text += row.Cells(1).Text &amp; "/" &amp; row.Cells(2).Text &amp; "/" &amp; row.Cells(3).Text &amp; " not found "
                  End If
  
              Next
          Next
  </code></pre>
  
  <p>is there a better way to find a match between the two? i'm dying here.</p>