Dim t1 As Date = Date.Now
Dim dic As New Dictionary(of DataRow, String)
Dim dic1 As New Dictionary(of DataRow, String)
Dim dic2 As New Dictionary(of DataRow, String)
Dim dr0 As DataRow
Dim drs As List(Of DataRow)
For Each dr As DataRow In DataTables("表A").DataRows
dr0 = DataTables("表A").Find("[第二列] = " & dr("第一列") & " And [第三列] = false" )
If dr0 isnot Nothing
dic.Add(dr,dr0("_identify")) '同下:::::::
dic1.Add(dr,dr0("第一列")) '找到的第二列对应的第一列的数字
dic2.Add(dr,dr0("第二列")) '找到的第二列等于当前行第一列的数字
dr0("第三列") = True '上面这个条件[第三列] = false是为了排除已经找到过的行
End If
Next
For Each dr As DataRow In dic.Keys
dr("第八列") = dic(dr)
Next
For Each dr As DataRow In dic1.Keys
dr("第九列") = dic1(dr)
Next
For Each dr As DataRow In dic2.Keys
dr("第十列") = dic2(dr)
Next
For Each dr As DataRow In DataTables("表A").DataRows
If dr.IsNull("第六列")
dr("第三列") = False
End If
Next
Output.Show("计算结束, 耗时: " & (Date.Now - t1).TotalSeconds & "秒") ‘我这计算结束, 耗时:245.2546秒
这是测试用的项目:(是原来狐表的例子)
筛选后的效果图:
此主题相关图片如下:未命名.jpg

[此贴子已经被作者于2010-12-14 17:27:52编辑过]