标录明细共有30行,输入最高家数为6家时,共耗时3.8秒,如何优化下面这段代码??
Dim filt As String = "系统编号 = '" & e.DataRow("系统编号") & "'"
Case "最高家数"
'Dim dts As List(Of DataRow) = Tables("开标记录.标录明细").DataTable.Select("系统编号 = '" & dr("系统编号") & "' And [有效报价] > 0 " ,"有效报价 DESC")
Dim dts As List(Of DataRow) = DataTables("标录明细").Select(filt & "And [有效报价] > 0 " ,"有效报价 DESC")
If e.NewValue <> e.OldValue AndAlso dts.Count > e.NewValue Then
For n As Integer = 0 To dts.Count -1
If dts(n)("评标状态").Contains("最高报价")
dts(n)("评标状态") = Nothing
End If
Next
'Tables("开标记录.标录明细").DataTable.ReplaceFor("评标状态",Nothing,filt)
For i As Integer = 0 To e.NewValue -1
dts(i)("评标状态") = "最高报价" & (i+1)
Next
Else
MessageBox.Show("请先录入标录明细后,再执行!")
End If