Quantcast
Channel: Planet Object Pascal
Viewing all articles
Browse latest Browse all 1725

The Podcast at Delphi.org: FireDAC In-Memory DataSet: TFDMemTable

$
0
0

More information and resources on TFDMemTable from the FireDAC Skill Sprint.

Here are the slides for now, the replay will be available soon.

Common code samples:

Delphi / Object Pascal

// Create Field Definitions
FDMemTable1.FieldDefs.Add('ID', ftInteger, 0, False);
FDMemTable1.FieldDefs.Add('Name', ftString, 20, False);
FDMemTable1.CreateDataSet;

// Append data
FDMemTable1.Open;
FDMemTable1.AppendRecord([1, 'Jim']);

// Load from another DataSet
FDMemTable1.CopyDataSet(DataSet1, [coStructure, coRestart, coAppend]);

C++

// Create Field Definitions
FDMemTable1->FieldDefs->Add("ID", ftInteger, 0, False);
FDMemTable1->FieldDefs->Add("Name", ftString, 20, False);
FDMemTable1->CreateDataSet();

// Append Data
FDMemTable1->Open();
FDMemTable1->Append();
FDMemTable1->FieldByName("ID")->AsInteger = 1;
FDMemTable1->FieldByName("Name")->AsString = "Jim";
FDMemTable1->Post();

// Load from another DataSet
FDMemTable1->CopyDataSet(DataSet1, TFDCopyDataSetOptions() << coStructure << coRestart << coAppend);

More information:

  • Samples
    • C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDMemTable
    • C:\Users\Public\Documents\Embarcadero\Studio\15.0\Samples\Object Pascal\Database\FireDAC\Samples\Comp Layer\TFDLocalSQL
  • DocWiki

Cary Jensen’s CodeRage 9 Video: TFDMemTable & ClientDataSet Compared [Q&A Log]

Dmitry Arefiev’s CodeRage 9 FireDAC Tips, Tricks and News


Viewing all articles
Browse latest Browse all 1725

Trending Articles