Foxtable(狐表)用户栏目专家坐堂 → 如何把返回的json值填入到table中?


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

主题:如何把返回的json值填入到table中?

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
如何把返回的json值填入到table中?  发帖心情 Post By:2019/5/28 11:58:00 [显示全部帖子]

如何把webservice返回的json值填入到table中?  并且后面我要修改该table中的某字段,如何在修改字段后触发调用 另外一个webservice?

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/28 12:47:00 [显示全部帖子]

调用成功,也能取出值来。

问题是,我用table一般是绑定某表啊,不知道这种情况下如何绑定啊。

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/28 16:48:00 [显示全部帖子]

那像这种临时表,能写表事件吗?能给个代码示例吗?

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/28 17:48:00 [显示全部帖子]

我可以固定表结构,也可以动态调整显示不同的列,但是动态的生成的sqlquery表事件怎么写啊?

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/28 19:15:00 [显示全部帖子]

如果不开启全局表事件, 用的临时表的话,如何写表事件?

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/29 10:58:00 [显示全部帖子]

执行代码:
                 Dim str4 As String = "http://172.16.*.*:2000/Auth.asmx/Bedinfo_query?xml=<xml><nurse_cell_code>0494</nurse_cell_code></xml>"
                 Dim hc As New HttpClient(str4)
                 Dim ret As String = hc.GetData()
                 MessageBox.Show(ret)     '可以弹出返回值


                   
                    Dim xmlDoc As New System.XML.XmlDocument
                    xmlDoc.Loadxml(ret)

                    Dim ndList  = xmlDoc.GetElementsByTagName("string")

                    Dim json = ndList(0).innerText
                    Dim jo As JArray=JArray.parse(json)
                   ' msgbox(jo(0)("金额") )
                  '  msgbox(jo(0)("BED_NO") )

返回错误:

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看



返回的json如下:


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

请问是什么问题?



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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/29 11:27:00 [显示全部帖子]


[{"BED_NO":"04941","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":1,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04942","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":2,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04943","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":3,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04944","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":4,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04945","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":5,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04946","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":6,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04947","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":7,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04948","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":8,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"04949","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":9,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049410","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":10,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049411","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":11,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049412","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":12,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049413","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":13,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049414","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":14,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:39\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049415","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":15,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:51:40\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049416","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":16,"OPER_CODE":"admin","OPER_DATE":"\"2015/10/31 23:39:00\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049417","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":17,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049418","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":18,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049419","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":19,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049420","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":20,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049421","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":21,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049422","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":22,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049423","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":23,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049424","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":24,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049425","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"O","BED_STATE":"O","WARD_NO":"1","SORT_ID":25,"OPER_CODE":"admin","OPER_DATE":"\"2015/9/29 16:52:25\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049426","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":26,"OPER_CODE":"admin","OPER_DATE":"\"2018/8/9 9:18:06\"","GRADENAME":"无床位费","SUMFEE":null},{"BED_NO":"049427","NURSE_CELL_CODE":"0494","FEE_GRADE_CODE":"41","BED_WEAVE":"I","BED_STATE":"O","WARD_NO":"1","SORT_ID":27,"OPER_CODE":"admin","OPER_DATE":"\"2018/8/10 14:34:45\"","GRADENAME":"无床位费","SUMFEE":null}],[{"RETURN_CODE":"0","ERROR_MSG":""}]



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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/29 11:38:00 [显示全部帖子]

[{"RETURN_CODE":"0","ERROR_MSG":""}]
把最后的这段去掉就OK了,

再问
Dim json As String = "[{'name':'李云龙','age':'36'},{'name':'黄晓明','age':'28'}]"

能否把字段的名称提出来?即:name  age 

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/29 12:02:00 [显示全部帖子]


图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看


能否把临时表的多层表头  关闭?  只关这个表的,不能都关

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


加好友 发短信
等级:六尾狐 帖子:1228 积分:8561 威望:0 精华:0 注册:2016/2/2 21:52:00
  发帖心情 Post By:2019/5/29 15:37:00 [显示全部帖子]

DataTables("产品").MultiRowHeader = False
DataTables
("产品"
).BuildHeader()

这代码是只关闭 “产品” 这个表的,还是关闭了所有表的?  顺便问下这代码放哪里?

 回到顶部
总数 14 1 2 下一页