以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- jarry问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=179650) |
-- 作者:qaz17909 -- 发布时间:2022/9/1 17:28:00 -- jarry问题 JARRY转字符串之后,直接向ft赋值和用sql写入,得到的值不一样? Dim arr As New JArray Dim obj1 As New JObjectobj1("单号") = "A001" arr.Add(obj1) Dim obj2 As New JObject obj2("单号") = "A002" arr.Add(obj2) Dim str As String = CompressJson(arr) CurrentTable.Current("一级分类") = str (得到的值为:[{"单号":"A001"},{"单号":"A002"}]) Dim cmd As New SQLCommand cmd.C cmd.CommandText = "Insert Into test (一级分类) Values(\'" & str & "\');Select SCOPE_IDENTITY()" cmd.ExecuteNonQuery DataTables ("test").Load() (得到的值为:[["单号":"A001"],["单号":"A002"]]) 两者不一样,一个为{},一个为[]
|
-- 作者:有点蓝 -- 发布时间:2022/9/1 17:37:00 -- 改为参数化用法:http://www.foxtable.com/webhelp/topics/3266.htm |