Xalion发现data.DBJson单元,不知什么时候加的,官方帮助中也没有写。
procedure TForm18.Button2Click(Sender: TObject); var cV: TDatasetToJSONBridge; jo: Tjsonobject; begin cV := TDatasetToJSONBridge.Create; try cV.Dataset := mt; jo := Tjsonobject(cV.Produce); Memo1.Lines.Add(jo.ToString); finally cV.Free; end; end;
导出结果:
[{ "f1": "0", "f2": 0, "f3": 0, "f4": 0 }, { "f1": "1", "f2": 1, "f3": 1, "f4": 1 }]
感谢Xalion!
标签:f2,f3,f4,Delphi,导出,DataSet,Json,jo,cV From: https://www.cnblogs.com/kinglandsoft/p/17475160.html