e.Form.BaseForm.windowstate = 2
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.connectionname =
Dim ccb1 As WinForm.CheckedComboBox= e.Form.Controls("checkedcombobox1")
If js.Contains("区业务主管")
cmd.CommandText = "SE/ECT DISTINCT 考试名称,单位名称,年级,班级 From {成绩} where 学段 ='初中' order by 考试名称 desc "
ccb1.ComboList = DataTables("考试名称").GetComboListString("考试名称","学段 = '初中'","考试名称 desc")
Dim dt1 As DataTable = DataTables("考试名称")
Dim cmb4 As WinForm.ComboBox = e.form.Controls("ComboBox1")
Dim cmb5 As WinForm.ComboBox = e.form.Controls("ComboBox5")
cmb4.ComboList = dt1.GetComboListString("考试名称","学段='初中'","考试名称 desc")
cmb5.ComboList = dt1.GetComboListString("考试名称","学段='初中'","考试名称 desc")
E.Form.Controls("BUTTON13").Visible=True
Else
cmd.CommandText = "SE/ECT DISTINCT 考试名称,单位名称,年级,班级,学段 From {成绩} where 单位名称 = '" & _usergroup & "' and 学段 = '初中' and 考试名称 in (Sel ect 考试名称 From {考试名称} where 是否可看 = 1 and 学段='初中') order by 考试名称 desc"
Dim dt1 As DataTable = DataTables("考试名称")
Dim cmb4 As WinForm.ComboBox = e.form.Controls("ComboBox1")
Dim cmb5 As WinForm.ComboBox = e.form.Controls("ComboBox5")
ccb1.ComboList = DataTables("考试名称").sqlGetComboListString("考试名称","学段 = '初中' and 暂不统计=0","考试名称 desc")
cmb4.ComboList = dt1.sqlGetComboListString("考试名称","学段='初中' and 是否可看 = 1","考试名称 desc")
cmb5.ComboList = dt1.sqlGetComboListString("考试名称","学段='初中' and 是否可看 = 1","考试名称 desc")
End If
messagebox.show("问题1")
dt = cmd.ExecuteReader()
messagebox.show("问题2")
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
messagebox.show("问题3")
trv.BuildTree(dt,"考试名称|单位名称|年级|班级", "" ,"考试名称 desc")
messagebox.show("问题4")
老师,项目没有改过(至少这个代码没改过),以前都是好的,今天打开项目运行这个代码时出现:未将对象引用设置到对象的实例。检到问题3要显后出提示,但没看出问题3和问题4有什么问题,关键是确实没改过,请老师指点,谢谢