Data.DB.TDataSet.GetFieldNames

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type:
procedure
function
Visibility: public
Source:
Data.DB.pas
Data.DB.hpp
Unit: Data.DB
Parent: TDataSet

Delphi

procedure GetFieldNames(List: TStrings); virtual;

C++

virtual void __fastcall GetFieldNames(System::Classes::TStrings* List);

Description

Retrieves a list of names for all fields in a dataset.

Call GetFieldNames to get a list of names for all fields in a dataset. List is a TStrings object created and maintained by the application. For example, to load a list box with the field names of a table,



SQLDataSet1.GetFieldNames(ListBox1.Items);



SQLDataSet1->GetFieldNames(ListBox1->Items);



Retrieving a list of field names is especially useful for applications that work with datasets whose field objects are created dynamically at runtime. By retrieving a list of field names, the application can be restricted to working only with fields that exist at runtime.

Note: GetFieldNames does not add the names of any aggregated fields to the list.

See Also