Data Tabl es("表A").Fill("Sele ct * F rom {订单}", "nwind", False)
用 fill 的话,可以正常加载数据, 但是
用下面的代码的话, 系统会 假死, 十几分钟~~
前几天还好好的,但昨天开始突然就假死了,
有什么别的办法么?
SystemR eady = False
Try
Dim cmd As New SQL Comm and
Dim dt As DataTable
Statu sBar.Message1= "システムデータ更新中"
Statu sBar.Progr essBar.Visible =True
cm d.Connect i
cm d.Com mandText = "SE LECT COU NT(*) FROM {st_7610490_Data}"
Dim sum As Single =cmd.Execut eScalar()
Status Bar.Progr essBar.Maximum = sum '设置最大值
Statu sBar.Progr essBar.Minimum = 0 '设置最小值
Status Bar.Progr essBar.Value = 0
cmd.C ommandT ext = "SELE CT * F rom {st_7610490_Data}"
dt = c md.ExecuteR eader()
DataTables("Data").DataRows.Clear
For Each dr As DataRow In dt.DataRows
If DataTables("Data").Find("商品型番 = '" & dr("商品型番") & "'") Is Nothing Then
Dim nr As DataRow = DataTables("Data").AddNew()
For Each dc As Data Col In dt.DataCols
nr(dc.name) = dr(dc.name)
Next
Statu sBar.Prog essBar.Value = StatusB ar.Progres sBar.Value + 1
Applic ation.Doeve nts
End If
Next
Sta tusBar.Res et()
Catch ex As Exception
Messag eBox.Show("追加数据失败")
End Try
System Ready = True
Return Nothing