还是老问题:
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
Dim flt As String ' = e.Cookies("yjbb")
If flt = "" Then
If e.PostValues.ContainsKey("product") Then
flt &= "年级 = '" & e.PostValues("product") & "'"
End If
If e.PostValues.ContainsKey("bj") Then
If flt > "" Then
flt = flt & " and "
End If
flt &= "班级 = '" & e.PostValues("bj") & "'"
End If
If e.PostValues.ContainsKey("jdc") Then
If flt > "" Then
flt = flt & "and "
End If
flt &= "街道村 = '" & e.PostValues("jdc") & "'"
End If
If e.PostValues.ContainsKey("dqzt") Then
If flt > "" Then
flt = flt & " and "
End If
flt &= "当前状态 = '" & e.PostValues("dqzt") & "'"
End If
If e.PostValues.ContainsKey("cxyy") Then
If flt > "" Then
flt = flt & "and "
End If
flt &= "辍学原因 = '"& e.PostValues("cxyy") & "'"
End If
If e.PostValues.ContainsKey("ksnl") Then
If flt > "" Then
flt = flt & "and "
End If
flt &= flt & "年龄 > '" & e.PostValues("ksnl") & "'"
End If
If e.PostValues.ContainsKey("jsnl") Then
If flt > "" Then
flt = flt & "and "
End If
flt &= flt & "年龄 < '" & e.PostValues("jsnl") & "'"
End If
msgbox(1)
msgbox(flt) 正确
wb.AppendCookie("yjbb",flt)
End If
msgbox("Select * fro m {控缀保学} where " & e.Cookies("yjbb")) 正确
Dim page As Integer = 0 '默认page为0,显示第一页
Dim pageRows As Integer = 10 '每页10行
If e.GetValues.ContainsKey("page") Then '如果地址中有page参数
Integer.TryParse(e.GetValues("page"), page) '提取page参数
End If
msgbox(2)
msgbox(flt) 弹出
Dim StartRow As Integer = page * pageRows + 1 '此页第一行
Dim EndRow As Integer = (page + 1) * pageRows '此页最后一行
msgbox(3) '提取此页数据 弹出
Dim cmd As New SQLCommand
cmd.C '记得设置数据源名称
Dim yjbb As String '定义一个变量,为excel报表传递查询条件
cmd.CommandText = "Select Count(*) Fr om {控缀保学}"
If flt > "" Then
msgbox(4) 弹出
cmd.CommandText = cmd.CommandText & "where" & flt
End If
msgbox(5) 正常弹出
Dim Count As Integer = cmd.ExecuteScalar() '获取总的行数 cmd.ExecuteScalar() 不知怎么用。分页不正确,少于10行正确,多于10行只显示10行,且显示的内容不都是筛选的内容。
msgbox(6) 弹出前报错:“=”附近有语法错误。
cmd.CommandText = "Select * Fro m (Select Row_Number() Over(Order by 出生日期) As [NO.],[_Identify],学生姓名,年级,班级,年龄,家长姓名,联系电话,地址 Fro m 控缀保学"
If flt > "" Then
cmd.CommandText = cmd.CommandText & " where " & flt
End If
cmd.CommandText = cmd.CommandText & ") As a "
cmd.CommandText = cmd.CommandText & " Where [NO.]>= " & StartRow & " And [NO.] <= " & EndRow
With wb.AddActionSheet("","menu") '设计菜单
.Add("mnudAdd", "增加记录").Attribute =""
.Add("mnuEdit", "编辑记录").Attribute =""
.Add("mnuEdit", "生成Excel报表","kcbxexcel.htm")
.Add("mnuCancel","取消","",True)
'.Add("mnuStatistics", "数据统计","tongji.htm")
....................