Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Discover The Powerful In Memory TFDMemTable Data Table In Delphi

The Main sample shows you how to use different database functionalities related with the TFDMemTable class. To this end, the sample uses different properties and methods of the cited class. The following dataset features are implemented:

Location

You can find the Main sample project at:

How to Use the Sample

  1. Navigate to the location given above and open CDS_main.dproj.
  2. Press F9 or choose Run > Run.

Files

File in DelphiContains
CDS_main.dproj
CDS_main.dpr
The project itself.
fMainDemo.pas
fMainDemo.fmx
The main form.

Implementation

The goal of this sample is to show how to implement different functionalities related with the TFDMemTable class. To this end, the sample first configures the main components:

This component is used to browse a database table and edit its records. To this end, the ConnectionName property is set to SQLite_Demo using the Object Inspector at design time.

This component retrieves data from database through TFDTable. To this end, the sample implements a FormCreate event that uses the CopyDataSet method to copy on run time the records from FDTable1 to MT.

This component provides an interface between a dataset component and data-aware controls on a form. In this sample, it is used to provide communication between the dataset and the grid where the dataset is displayed. To this end, the DataSet property of DataSource1 is set to MT and the DataSource property of DBGrid1 is set to DataSource1. This set up is done at design time using the Object Inspector.

When you run the application, you see a multiple page dialog and a table displayed on DBGrid1. The grid is used to display and manipulate records from MT. Once the grid is filled, you can interact with the sample by using the features that are implemented in each tab:

More detailsed information can be found on the link below:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FireDAC.TFDMemTable.Main_Sample

Head over and check out the full source code for the main TFDMemTable demo on GitHub.

Exit mobile version