Foxtable(狐表)用户栏目专家坐堂 → [求助]WEB查询问题


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

主题:[求助]WEB查询问题

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


加好友 发短信
等级:三尾狐 帖子:681 积分:5332 威望:0 精华:0 注册:2011/12/26 20:43:00
[求助]WEB查询问题  发帖心情 Post By:2017/4/7 13:06:00 [只看该作者]

S elect Cas e e.Path
    Case "bjkc.htm"
        wb.AddForm("","form1","bjkc.htm")
        With wb.AddInputGroup("form1","ipg1","库存查询")
            .AddInput("bjmc","备件名称:","text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "查询", "submit")
        End With
        Dim cmd1 As New SQLCommand
        cmd1.C 
        cmd1.CommandText = "SE L ECT ID AS 物料ID,JIGOU AS 所属机构,CANGKU AS 所属仓库,MINGCHENG AS 物料名称,SHULIANG AS 库存数量 F R OM KUCUN"
        Dim dt1 As DataTable = cmd1.ExecuteReader    
        With wb.AddTable("","Table1")
            .CreateFromDataTable(dt1,False)
        End With
End Sel ect

老大求救,怎么点击查询按钮先查询数据然后再根据datatable生成表格,帮忙修改一下

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


加好友 发短信
等级:超级版主 帖子:110592 积分:562856 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/4/7 14:07:00 [只看该作者]

简单一点就这样

S elect Cas e e.Path
Case "bjkc.htm"
    If e.PostValues.Count = 0 Then
        wb.AddForm("","form1","bjkc.htm")
        With wb.AddInputGroup("form1","ipg1","库存查询")
            .AddInput("bjmc","备件名称:","text")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "查询", "submit")
        End With
    Else
        Dim cmd1 As New SQLCommand
        cmd1.C
        cmd1.CommandText = "SE L ECT ID AS 物料ID,JIGOU AS 所属机构,CANGKU AS 所属仓库,MINGCHENG AS 物料名称,SHULIANG AS 库存数量 F R OM KUCUN where 备件名称='" & e.PostValues("bjmc") & "'"
        Dim dt1 As DataTable = cmd1.ExecuteReader
        With wb.AddTable("","Table1")
            .CreateFromDataTable(dt1,False)
        End With
    End If
End Sel ect


 回到顶部