My answer to your earlier q here: How to Get Images From Server using App Tethering showed you how to transfer data in a TClientDataSet in the server to one in a client using app tethering.
That method of transfer relies on a TClientDataSet's ability to save its data to a stream on the server side and to load it from a stream on the client side, using its SaveToStream
and LoadFromStream
. In this q, although you haven't said what your 2 rQuery components are, you are obviously using FireDAC, and its FDQuery, FDMemTable, etc have SaveToStream
and LoadFromStream
methods which work in a similar, virtually identical manner (from the user's pov) to the TClientDataSet. So to "update" your client-side dataset from the server-side one, you can use your dataset components in a similar manner as I've shown in my answer to your other q.
To save other readers a visit to the other q, the FireDAC code is
Server:
procedure TServerApp.DataSetToStream;
var
Stream : TMemoryStream;
begin
Stream := TMemoryStream.Create;
FDQuery1.SaveToStream(Stream);
Stream.Position := 0;
TetheringAppProfile1.Resources.FindByName('BioLife').Value := Stream;
end;
Client
procedure TCliemtApp.TetheringAppProfile1Resources0ResourceReceived(const Sender:
TObject; const AResource: TRemoteResource);
begin
AResource.Value.AsStream.Position := 0;
FDMemTable1.LoadFromStream(AResource.Value.AsStream);
end;