Foxtable(狐表)用户栏目专家坐堂 → DataTable.LoadFilter加载


  共有3115人关注过本帖树形打印复制链接

主题:DataTable.LoadFilter加载

帅哥哟,离线,有人找我吗?
sdscen
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:254 积分:2357 威望:0 精华:0 注册:2011/8/8 0:50:00
DataTable.LoadFilter加载  发帖心情 Post By:2014/11/17 20:54:00 [只看该作者]

Dim nr As WinForm.TextBox = e.Form.Controls("查询内容")
Dim xzl As WinForm.ComboBox = e.Form.Controls("选择列")
Dim je As WinForm.TextBox = e.Form.Controls("金额")
Dim d As WinForm.Label = e.Form.Controls("Label1")
Dim f As Table = Tables("主窗口_子窗体")
Dim b As Table = Tables("主窗口_子窗口2")
Dim shcx As WinForm.ComboBox = e.Form.Controls("审核查询")
If xzl.Value <> "全部" Then
    If f.ColS(""& xzl.Value &"").IsDate Then
        Dim rqgs As Date = nr.Value
        If rqgs <> Nothing Then
            If shcx.Value = "未审核" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " = #" & rqgs & "# And 审核状态 = False "
            Else If shcx.Value = "已审核" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " = #" & rqgs & "# And 审核状态 = True "
            Else If shcx.Value = "全部" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " = #" & rqgs & "# "
            End If
        Else If rqgs = Nothing Then
            If shcx.Value = "未审核" Then
                f.DataTable.LoadFilter = "审核状态 = False "
            Else If shcx.Value = "已审核" Then
                f.DataTable.LoadFilter = "审核状态 = True "
            Else If shcx.Value = "全部" Then
                f.DataTable.LoadFilter = ""
            End If
        End If
    Else If f.ColS(""& xzl.Value &"").IsNumeric Then
        Dim szgs As Double = nr.Value
        If szgs <> Nothing Then
            If shcx.Value = "未审核" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " = " & szgs & " And 审核状态 = False "
            Else If shcx.Value = "已审核" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " = " & szgs & " And 审核状态 = True "
            Else If shcx.Value = "全部" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " = " & szgs & ""
            End If
        Else If szgs = Nothing Then
            If shcx.Value = "未审核" Then
                f.DataTable.LoadFilter = " 审核状态 = False "
            Else If shcx.Value = "已审核" Then
                f.DataTable.LoadFilter = " 审核状态 = True "
            Else If shcx.Value = "全部" Then
                f.DataTable.LoadFilter = ""
            End If
        End If
    Else
        If nr.Value = "" Then
            If shcx.Value = "未审核" Then
                f.DataTable.LoadFilter = "审核状态 = False "
            Else If shcx.Value = "已审核" Then
                f.DataTable.LoadFilter = "审核状态 = True "
            Else If shcx.Value = "全部" Then
                f.DataTable.LoadFilter = ""
            End If
        Else
            If shcx.Value = "未审核" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " like '*" & nr.Value & "*' And 审核状态 = False "
            Else If shcx.Value = "已审核" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " like '*" & nr.Value & "*' And 审核状态 = True "
            Else If shcx.Value = "全部" Then
                f.DataTable.LoadFilter = "" & xzl.Value & " like '*" & nr.Value & "*'"
            End If
        End If
    End If
Else If xzl.Value = "全部" Then
    If shcx.Value = "全部" Then
        f.DataTable.LoadFilter = ""
    Else If  shcx.Value = "已审核" Then
        f.DataTable.LoadFilter = " 审核状态 = true "
    Else If shcx.Value = "未审核" Then
        f.DataTable.LoadFilter = " 审核状态 = false "
    End If
    Tables("主窗口_子窗体").AutoSizeCols()
    je.Text = f.Compute("sum([金额])")
End If
f.DataTable.Load

以上红字部分代码执行时查不到数据(实际数据有,数据类型为字符型),其他部分全部都正常,请高手指点下是什么问题

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/11/17 20:56:00 [只看该作者]

 like 不能用 * 要用 %

 

 f.DataTable.LoadFilter = "" & xzl.Value & " like '%" & nr.Value & "%' And 审核状态 = False "


 回到顶部