--
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.connectionname =
If js.Contains("区业务主管")
cmd.CommandText = "SELEC T DISTINCT 考试名称,单位名称,年级代码,班级,学段 From {成绩} where 学段 =\'小学\'"
Else
cmd.CommandText = "SELEC T DISTINCT 考试名称,单位名称,年级代码,班级,学段 From {成绩} where 单位名称 = \'" & _usergroup & "\' and 学段 = \'小学\' and 考试名称 = (Sel ect 考试名称 From {小学考试名称} where 是否可查 = 1)"
End If
dt = cmd.ExecuteReader()
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree(dt,"考试名称|单位名称|年级代码|班级")
\'trv.Nodes.Insert("加载所有数据",0)
DataTables("成绩").loadfilter = "[_Identify] Is null"
DataTables("成绩").load
Dim lbl As WinForm.Label = e.Form.Controls("Label1")
If e.Form.Width > lbl.Width
lbl.Left = (e.Form.Width - lbl.Width ) / 2
End If
Dim dt1 As DataTable = DataTables("小学考试名称")
Dim cmb4 As WinForm.ComboBox = e.form.Controls("ComboBox1")
cmb4.ComboList = dt1.GetComboListString("考试名称","归档 = false")
\'Dim cmb2 As WinForm.CheckedComboBox = e.form.Controls("CheckedComboBox1")
\'cmb2.ComboList = dt1.GetComboListString("考试名称","是否可查 = true")
我想了个查询方案,但当有多个考试名称为TRUE时提示:子查询返回的值不止一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。