以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  HttpRequest  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=113953)

--  作者:huhu
--  发布时间:2018/1/25 17:43:00
--  HttpRequest
Case "fhdh.htm"
        If e.getValues.Count > 0 Then
            Dim Multi As String = e.getValues("fhdh")
            Dim jo As New JObject
            Dim ja As New JArray
            jo(Multi) =  ja
            Dim drs As List(of DataRow) = DataTables("库存明细表").SQLSelect("U8发货单号 = \'" & Multi & "\'")
            If drs.count > 0  Then
                Dim Index As Integer = 0
                For Each dr As DataRow In drs
                    ja.Add(New JObject)
                    ja(Index)("SN") = dr("SN").Tostring()
                    ja(Index)("MAC") = dr("MAC").Tostring()
                    ja(Index)("物料编码") = dr("物料编码").Tostring()
                    ja(Index)("订单号") = dr("订单号").Tostring()
                    ja(Index)("U8发货单号") = dr("U8发货单号").Tostring()
                    ja(Index)("U8出库单号") = dr("U8出库单号").Tostring()
                    ja(Index)("货运单号") = dr("货运单号").Tostring()
                    Index = Index + 1
                Next
            Else
                ja(0)("SN") = ""
                ja(0)("物料编码") = ""
                ja(0)("订单号") = ""
                ja(0)("U8发货单号") = ""
                ja(0)("U8出库单号") = ""
                ja(0)("货运单号") = ""
            End If
            e.WriteString(jo.ToString)
        End If
错误所在事件:项目,HttpRequest
详细错误信息:
索引超出范围。必须为非负值并小于集合大小。
参数名: index


--  作者:有点甜
--  发布时间:2018/1/25 18:29:00
--  
ja.Add(New JObject) 之后,才能用 0、1、2、3 这些