, пожалуйста, помогите мне сделать мое приложение немного быстрее, это займет целую вечность, чтобы пройти и дать мне результаты прямо сейчас.
вот что мне нужно: 1. загрузить gridview из загруженного файла Excel (это будетвероятно, будет около 300 записей или около того) 2. сравните производителя, модель и серийный номер с моей базой данных MS SQL (около 20 000 записей), чтобы выяснить, есть ли совпадение.
'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 & "/" & row.Cells(2).Text & "/" & row.Cells(3).Text & " found"
Else
lblResults.Text += row.Cells(1).Text & "/" & row.Cells(2).Text & "/" & row.Cells(3).Text & " not found "
End If
Next
Next
, есть ли лучший способнайти совпадение между двумя?я умираю здесь.