RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomClientDataSet.ChangeCount Property

Indicates the number of changes in the change log.

Pascal
property ChangeCount: Integer;
C++
__property int ChangeCount;

Check ChangeCount to determine how many modifications are pending for the dataset. ChangeCount increases when the data is edited. It is reset when updates are applied or merged and any differences are reconciled by the client dataset.  

Delphi Examples: 

 

{
This BeforeDisconnect event handler makes sure that the
client dataset has applied all its pending updates before
terminating the connection to the server.
}
procedure TForm1.RemoteServer1BeforeDisconnect(Sender: TObject);
begin
  if (ClientDataSet1.ChangeCount > 0) then 
    ClientDataSet1.ApplyUpdates(-1);
end;

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!