以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]网络接口分页数据请求  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=175518)

--  作者:crazyfengyu
--  发布时间:2022/3/8 10:29:00
--  [求助]网络接口分页数据请求
我想使用狐表读取数据库返回给页面在HttpRequest里面写了

    Case "getOrder.html"
        e.ResponseHeaders.Add("Access-Control-Allow-Origin","*")
        Dim page As Integer = 1
        If e.GetValues.ContainsKey("page") Then  \'如果地址中有page参数
            page = e.GetValues("page") \'提取page参数
        End If
        Dim pageS As Integer = (page - 1) * 5 + 1
        Dim pageE As Integer = page * 5
        Dim sql As String
        sql  = "elect * From (elect Row_Number() Over(Order by _Identify) As RowNum, * from 订单表) "
        sql = sql & " Where RowNum >= " & pageS & " And RowNum <= " & pageE
        Dim or As List(of DataRow) = DataTables("订单表").SQLSelect(sql)
        Dim ms As New JArray
        For Each o As DataRow In macs
            Dim jo As New JObject
            jo("id") = Cstr(o("id"))
            jo("orderid") = Cstr(o("订单号"))
            ms.Add(jo)
        Next
        Dim lobj As New JObject
        lobj("list") = ms
        e.WriteString(lobj.ToString)




返回的数据一直是空,请问是什么问题?

--  作者:有点蓝
--  发布时间:2022/3/8 10:52:00
--  
执行SQL要使用SQLcommand,而不是SQLSelect