核对表里大概3000行数据,明细列表里大概500个明细表,代码没错,但是找10几个出来就崩溃了,咋办?
For Each olddr As DataRow In DataTables("核对表").DataRows Dim no As String = olddr("编号") For Each dr As DataRow In DataTables("明细列表").DataRows Dim tblName As String = dr("列表名称") If DataTables.Contains(tblName) = False Then DataTables.Load(tblName) End If Dim newdr As DataRow = DataTables(tblName).Find("编号 = '" & no & "'") If newdr IsNot Nothing Then olddr("名称") = newdr("名称") DataTables.UnLoad(tblName) Exit For Else DataTables.UnLoad(tblName) End If Next Next
|