I have Server And Client App.
From Server side there are 2 buttons.
1st button "Display Data On Server".
2nd button "Send Data to Client".
In a Server side i'm using FDQuery1
, SringGrid1
, TetheringManager1
and TetheringAppProfile1
.
From Client Side only 1 button "Connect". In a Client Side I'm using StringGrid1, TetheringManager1 and TetheringAppProfile1
So First Client Connecting to the Server then Server Side sending data to client.
Server "Send Data to Client" button
Code:
procedure TForm1.Button2Click(Sender: TObject);
var rec:integer;
begin
FDQuery1.SQL.Text := 'SELECT * FROM names';
FDQuery1.Open;
rec := FDQuery1.RecordCount;
FDQuery1.First;
if rec>0 then
begin
while not FDQuery1.Eof do
begin
TetheringAppProfile1.Resources.FindByName('Vefa').Value:=FDQuery1.FieldByName('Name').AsString;
FDQuery1.Next;
end;
end;
Client Side Receive
Code:
procedure TForm2.TetheringAppProfile1Resources1ResourceReceived(
const Sender: TObject; const AResource: TRemoteResource);
var i:integer;
begin
for i := 0 to TetheringAppProfile1.Resources.Count do
StringGrid1.Cells[1,i]:=AResource.Value.AsString;
end;
But When I send data from Server to Client I see like this: