以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 目录树学生同名 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=129285) |
-- 作者:联友 -- 发布时间:2018/12/25 21:51:00 -- 目录树学生同名 学生信息表有学生编号(是唯一)、学生姓名、身份证号、父亲姓名等,用目录树输入,如果班级有同名怎么处理。请老师指教,谢谢! Dim dt As DataTable Dim cmd As New SQLCommandcmd.CommandText = "Sel ect 班级,学生姓名,a.学生编号 From ({学生信息} a INNER JOIN {缴学费} b ON a.学生编号 = b.学生编号) LEFT JOIN (Sel ect 学生编号 From {学生退费} Where 学期 = \'20181\' And 退费项目 = \'学费\') c ON b.学生编号 = c.学生编号 WHERE 学期 = \'20181\' And c.学生编号 Is Null ORDER BY a.学生编号" dt = cmd.ExecuteReader() Dim trv As WinForm.TreeView = Forms("窗口1").Controls("TreeView1") trv.BuildTree(dt,"班级|学生编号") trv.StopRedraw \'停止绘制目录树 For Each nd As WinForm.TreeNode In trv.AllNodes If nd.Level = 1 Then nd.Text = nd.DataRow("学生姓名") End If Next trv.ResumeRedraw \'恢复绘制目录树 [此贴子已经被作者于2018/12/25 21:55:20编辑过]
|
-- 作者:有点蓝 -- 发布时间:2018/12/25 21:56:00 -- 同时显示编号 nd.Text = nd.DataRow("学生姓名") & “ - ” & nd.DataRow("学生编号")
|
-- 作者:Liangcai -- 发布时间:2018/12/26 8:15:00 -- 好的 |