员工资料有8万多条数据,粮农直补有万多条数据
执行下列语句:
Dim dt1 As DataTable = DataTables("员工资料")
Dim dt2 As DataTable = DataTables("粮农直补")
Dim i1 As Integer = 0
Dim i2 As Integer = 0
For Each dr As DataRow In dt2.DataRows
Dim fdr As DataRow = dt1.find("身份证号 = '" & dr("身份证号") & "'")
If fdr IsNot Nothing Then
fdr("姓名")= dr("姓名")
i1 = i1+1
Else
Dim ndr As DataRow = DT1.ADDNEW()
ndr("身份证号") = dr("身份证号")
ndr("姓名") = dr("姓名")
i2 = i2 +1
End If
Next
PopMessage("共更新了" & i1 & "条记录" & vbcrlf & "新增了" & i2 & "条记录","通知", PopIconEnum.OK, 5)
结果虽然在运行,但是效率很低,查看运行情况
此主题相关图片如下:111.png

有什么办法提高效率?