var arr = [
{cn:"test",table:"补款表",re_col:"房号",re_v:row["房号"]},
{cn:"test",table:"车位成交表",re_col:"房号",re_v:row["房号"]},
{cn:"test",table:"地下室成交表",re_col:"房号",re_v:row["房号"]},
{cn:"test",table:"签约表",re_col:"房号",re_v:row["房号"]
}
以下代码报错:
无法将类型为“System.String”的对象强制转换为类型“Newtonsoft.Json.Linq.JToken”。
Dim drs As List(of DataRow) = DataTables("关联表").SQLSelect("父表 = '" & e.Values("q") & "'")
For Each dr As DataRow In drs
arr.Add(new jobject)
arr(i)("cn") = "test".ToString
arr(i)("table") = dr("子表").ToString
arr(i)("re_col") = dr("父表关联列").ToString
arr(i)("re_v")=cstr("Row[""" & dr("子表关联列") & """]")
i = i + 1
Next
Dim count2=DataTables("关联表").SQLCompute("Count(*)", "父表 = '" & e.Values("q") & "'")
obj("count") = count2.ToString
obj("children") = arr
e.WriteString(CompressJson(obj))