--
e.Form.BaseForm.windowstate = 2
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.c">If js.Contains("区业务主管")
cmd.CommandText = "SELE CT DISTINCT 考试名称,单位名称,年级代码,班级 From {成绩} where 学段 =\'初中\'"
Dim dt1 As DataTable = DataTables("考试名称")
Dim cmb4 As WinForm.ComboBox = e.form.Controls("ComboBox1")
cmb4.ComboList = dt1.GetComboListString("考试名称","学段=\'初中\'","考试名称 desc")
Else
cmd.CommandText = "SE LECT DISTINCT 考试名称,单位名称,年级代码,班级,学段 From {成绩} where 单位名称 = \'" & _usergroup & "\' and 学段 = \'初中\' and 考试名称 in (Se lect 考试名称 From {考试名称} where 是否可看 = 1 and 学段=\'初中\')"
Dim dt1 As DataTable = DataTables("考试名称")
Dim cmb4 As WinForm.ComboBox = e.form.Controls("ComboBox1")
cmb4.ComboList = dt1.GetComboListString("考试名称","学段=\'初中\' and 是否可看 = 1","考试名称 desc")
End If
dt = cmd.ExecuteReader()
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
\'trv.BuildTree(dt,"考试名称|单位名称|年级代码|班级", "" ,"考试名称 desc")
trv.BuildTree(dt,"考试名称|单位名称|年级代码|班级")
[此贴子已经被作者于2018/11/18 22:02:14编辑过]