以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  窗口统计  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=22874)

--  作者:良才
--  发布时间:2012/8/26 10:23:00
--  窗口统计
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.zip

在籍学生信息查询表有姓名、性别、照片列想把班级人、男、女分别统计代码怎样写?请师傅指点。谢谢!


--  作者:czy
--  发布时间:2012/8/26 11:23:00
--  

Dim dt As DataTable = DataTables("在籍学生信息")
Dim Filter As String = "[班级] = \'" & e.Node.name & "\'"
Dim drs As List(of DataRow) = dt.Select(Filter,"")
For i As Integer = 0 To drs.Count - 1
    e.Form.Controls("Lable" & i+1).text = drs(i)("姓名")
    e.Form.Controls("PictureBox" & i + 1).Image =  GetImage(drs(i)("照片"))
Next
For i As Integer = drs.Count To 9
    e.Form.Controls("Lable" & i + 1).text = ""
    e.Form.Controls("PictureBox" & i + 1).Image = Nothing
Next

e.Form.Controls("Label1").text = drs.count
e.Form.Controls("Label2").text = dt.Compute("count(性别)",Filter & " And 性别 = \'男\'")
e.Form.Controls("Label3").text = dt.Compute("count(性别)",Filter & " And 性别 = \'女\'")