MessageBox.Show("校对无误后必须点击<确定>按钮以保存!")
Dim mc As WinForm.ComboBox = e.Form.Controls("ComboBox4")
Dim jb As WinForm.ComboBox = e.Form.Controls("ComboBox6")
Dim xm As WinForm.ComboBox = e.Form.Controls("ComboBox5")
If e.Form.Controls("ComboBox4").text = "级别" Then
MessageBox.Show("请选择竞赛名称/项目/级别!")
Return
End If
Dim dr0 As DataRow = DataTables("项目表"). Find ("竞赛名称简称 = '" & mc.text & "' and 竞赛项目简称 = '"& xm.text &"'")
Dim str As String = dr0("记录表表名")
Dim dt As DataTable = DataTables(str)
Dim dt1 As DataTable = DataTables("报名表")
Dim drs As List(of DataRow) =dt1.Select("竞赛名称 = '" & mc.text & "' And 项目 = '" & xm.Text & "' and 级别 = '"& jb.text &"'","组号,区号,学校")
Dim dr,fr As DataRow
For Each dr In drs
Dim bh As String = dr("编号")
If dt.find ("编号 = '"& bh &"'") Is Nothing Then
If dr("分项") = False
If dr("审核") = True
Dim Ary() As String = {"编号","级别","学校","姓名","组别","项目","竞赛名称","区","辅导老师","学号"}
fr = dt.AddNew
For i As Integer = 0 To 9
fr(Ary(i)) = dr(Ary(i))
Next
dr("分项") = True
Else
Dim s1 As String = dr("区")
Dim s2 As String = dr("学校")
Dim s3 As String = dr("姓名")
MessageBox.Show(s1 & s2 & s3 & "没有通过审核!")
End If
End If
End If
Next
以上是从报名表(外部表)导入到记录表(内部表)的代码 。导入1000行用时超过5分钟,太慢了!
请专家看看 ,帮我把代码优化一下。 谢谢!!!