我是这样做的:第一不死机,第二可了解进度。
还发现个问题:当前表焦点离开要遍历的表,速度要快很多。
Dim ggg As WinForm.Label = e.Form.Controls("Label1")
Dim sss As Double = 0
Dim hh As Double
Dim rs As Double
For Each dr As DataRow In DataTables("表A").DataRows
....................................................................
sss = sss + 1
If sss Mod 100 =0 Then
ggg.Text = sss
End If
Application.DoEvents
Next
ggg.Text = "OK"