Foxtable(狐表)用户栏目专家坐堂 → json生成的问题


  共有1555人关注过本帖平板打印复制链接

主题:json生成的问题

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


加好友 发短信
等级:狐精 帖子:3358 积分:24758 威望:0 精华:0 注册:2012/3/26 21:47:00
json生成的问题  发帖心情 Post By:2017/9/10 19:31:00 [只看该作者]

With Tables("销售订单")
    If .current IsNot Nothing Then
        Dim jo As New JObject
        jo("@number") =.current("订单号")
        jo("quantity") =.current("订单数量")
        jo("consignee") = .current("客户名称")
        jo("address") = .current("收货地址")
        jo("shipping-type")=.current("送货方式")
        Output.Show(jo.ToString)
    End If
    
End With

Dim jo As New JObject
jo("@number") =""
jo("quantity") = ""
jo("consignee") = ""
jo("address") = ""
jo("shipping-type")=""
Output.Show(jo.ToString)

红色部分能正常运行,但是用上面的就报错
---------------------------
版本:2017.8.19.1
---------------------------
代码执行出错,错误信息:



System.InvalidCastException: 无法将类型为“System.String”的对象强制转换为类型“Newtonsoft.Json.Linq.JToken”。

   在 UserCode.Test()
---------------------------
确定   
---------------------------



 回到顶部