没办法的,取值就至少需要10秒,赋值也需要时间
Dim st As Date = Date.Now
Dim ls As List(Of String) = DataTables("凭证").GetValues("凭证类别与编号")
Dim dic As new Dictionary(Of String, String)
For i As Integer = 0 To ls.count-1
Dim str As String = DataTables("凭证").GetComboListString("科目编码","凭证类别与编号 = '" & ls(i) & "'")
dic.add(ls(i), str)
Next
msgbox("耗时: " & (Date.Now - st).TotalSeconds & "秒")
For i As Integer = 0 To 3000
Dim dr As DataRow = DataTables("凭证").DataRows(i)
If dr.IsNull("借方金额") = False Then
dr("部门编码") = dic(dr("凭证类别与编号"))
End If
Next
MessageBox.Show("耗时: " & (Date.Now - st).TotalSeconds & "秒")