FireDAC.Comp.DataSet.TFDDataSet.IndexName

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 IndexName: String read FIndexName write SetIndexName;

C++

__property System::UnicodeString IndexName = {read=FIndexName, write=SetIndexName};

Description

Gets or sets the current index for the dataset by its name.

Use IndexName to specify the current index for the dataset. 

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on the dataset's default ordering. If IndexName contains the name of a valid index from the Indexes collection, then that index is used to determine data view (including sort order) of records. 

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other. 

Example

with FDMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
FDMemTable1.IndexName := 'by_name';

See Also