Datasnap the data type of the remote method that is added to support FIREDAC tfdjsondatasets

Source: Internet
Author: User

The previous blog mentions using FIREDAC to completely replace COM that set of things: Dataprovider,olevariant,clientdataset,dbexpress ...

Obviously, Datasnap's remote methods must increase the parameter types for the direct sequence of the FIREDAC dataset.

Add a new unit file starting from the UPDATE2 of XE5:data.firedacjsonreflect

Tfdjsondatasets is a DataSet list object that, as the name implies, can return one or more DataSet objects, whether single-table or master-slave table data can be passed.

Service-side Demo code:

function Tservermethods1.getjsondata:tfdjsondatasets;begin  Result: = tfdjsondatasets.create;  If not fdmemtable1.active then    fdmemtable1.loadfromfile ('.. /.. /customer.fds ')  else    fdmemtable1.active: = False;  Tfdjsondatasetswriter.listadd (Result, FDMemTable1); end;

Client Demo Code:
var  dslist:tfdjsondatasets;begin  Fdmemtable1.close;  Dslist: = ClientModule1.ServerMethods1Client.GetJSONData;  Fdmemtable1.appenddata (      tfdjsondatasetsreader.getlistvalue (dslist, 0));  Fdmemtable1.open;end;



Datasnap the data type of the remote method that is added to support FIREDAC tfdjsondatasets

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.