BeforeDisconnect (Delphi)
Contents
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
- Data.DB.TCustomConnection.BeforeDisconnect ( fr | de | ja )
- Datasnap.DBClient.TCustomClientDataSet.ChangeCount ( fr | de | ja )
- Datasnap.DBClient.TCustomClientDataSet.ApplyUpdates ( fr | de | ja )