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

Easily Learn To Store Data In A Nested Dataset using FireDAC With FireDAC.TFDMemTable.NestedDataSet Sample

The NestedDataSet sample shows you how to set a nested dataset in a dataset field.

Location

You can find the NestedDataSet sample project at:

Description

To this end, the sample uses the NestedDataSet property. Moreover, the sample implements the following functionalities that are attached to three different button events:

How to Use the Sample

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

Files

File in DelphiContains
NestedDataSet.dproj
NestedDataSet.dpr
The project itself.
fNested.pas
fnested.fmx
The main form.
fNestedCopy.pas
fnestedCopy.fmx
The copied datasets form.

Implementation

The goal of this sample is to demonstrate how to set nested datasets in dataset fields. To this end, the sample implements the following steps at run time:

When you run the application, you see a table displayed in a TDBGrid. The grid is used to display and manipulate records from FDMemTable1. Once the grid is filled, you can interact with the sample. Each of the following buttons implements an OnClick event to do what is described below:

Note: Both methods could work with three different file formats: binaryXML and JSON. The cited methods can work with the three file formats adding the following objects to the form: TFDStanStorageXMLLinkTFDStanStorageJSONLink and TFDStanStorageBinLink.

Note: The ShowModal property shows the fNestedCopy form as a modal form, which means that the application cannot continue to run until the modal form is closed.

Uses

Check out the full source code on GitHub!

Next, learn how you can append to String Python and answer other questions about String Operations in C++ software in this article.

Exit mobile version