FireDAC.Comp.DataSet.TFDDataSet.ChangeCount

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: public
Source:
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
Unit: FireDAC.Comp.DataSet
Parent: TFDDataSet

Delphi

property ChangeCount: Integer read GetChangeCount;

C++

__property int ChangeCount = {read=GetChangeCount, nodefault};

Description

Gets the number of changes in the change log.

Use ChangeCount to determine how many modifications are in the dataset's change log. ChangeCount:

  • Increases when the data is edited (for example, Edit / Post).
  • Decreases when changes are undone (for example, UndoLastChange).
  • Sets to zero after committing (CommitUpdates) or canceling all updates (CancelUpdates).

Example

procedure TForm1.FDQuery1AfterPost(DataSet: TDataSet);
begin
  if TFDDataSet(DataSet).ChangeCount = 0 then
    StatusBar1.SimpleText := 'no changes'
  else
    StatusBar1.SimpleText := Format('%d changed rows', [TFDDataSet(DataSet).ChangeCount]);
end;

See Also