BeforeDisconnect (Delphi)

From RAD Studio Code Examples
Jump to: navigation, search

Description

This BeforeDisconnect event handler makes sure that the client dataset has applied all its pending updates before terminating the connection to the server.

Code

procedure TForm1.RemoteServer1BeforeDisconnect(Sender: TObject);
begin
  if (ClientDataSet1.ChangeCount > 0) then 
    ClientDataSet1.ApplyUpdates(-1);
end;

Uses

See Also

Personal tools
Assistance