--
以下是引用有点蓝在2024/5/13 9:36:00的发言:
把BuildTree放到导入的代码后面不就行了这里还是不懂:
导入代码如下:
e.Form.Controls("Label1").Text = "正在从【基础数据】表中导入所选专业,大约耗时210秒,3分钟左右,请稍后..."
Application.DoEvents()
Dim timestart, timeend As Date
timestart = Date.now
For Each dr1 As DataRow In DataTables("基础数据").Select("[确定导入] = true")
Dim dr2 As DataRow = DataTables("专业分析").AddNew()
For Each dc As DataCol In DataTables("基础数据").DataCols
dr2(dc.Name) = dr1(dc.name)
Next
Next
Tables("专业分析").Sort = "低分等效 DESC" \'按"低分等效"列降序排列
Dim drs As List(Of DataRow)
drs = DataTables("专业分析").Select("[确定导入] = True")
For Each dr As DataRow In drs
dr("确定导入") = False
Next
e.Form.Controls("TreeView1").BuildTree("专业分析", "首选科目|低分同位分差|专业类|专业名称|省份") ‘这里是加上的BuildTree,提示找不到TreeView1。
e.Form.Controls("Label1").Text = "从【基础数据】表中所选专业导入完毕!"
timeend = Date.now
e.Form.Controls("Label1").text = "耗时" & (timeend - timestart).TotalSeconds & "秒"
Messagebox.show("从【基础数据】表中已导入符合条件的行,共" & (Tables("专业分析").rows.count) & "行", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
老师,这里如何修改
此主题相关图片如下:22.png