All column properties of a generated record class can also be found on the resultset class, for example:


CustomersRecordset customers = new CustomersRecordset();


first_name = customers[0].FirstName; // property on the record

first_name = customers.FirstName; // property on the resultset


On the first line the record's FirstName property is accessed. On the second line the resultset's FirstName property is accessed.


This is to support the concept of the Currently Selected Record.


The index of the currently selected record is in the CurrentRecordIndex property.


The record class for the currently selected record can be accessed with the CurrentRecord property.


If no current record is selected, the CurrentRecordIndex is -1, and the CurrentRecord is null;

What changes the Currently Selected Record?

Setting the CurrentRecord or CurrentRecordIndex property directly:


customers.CurrentRecordIndex = 5;

customers.CurrentRecord = customers[0];


After calling customers.ExecSql() it is set to the first record in the resultset:


customers.Load(5);


After calling customers.Append() it is set to the index of the new record:


customers.Append();


After calling customers.SelectFirstAsCurrentRecord() or customers.SelectLastAsCurrentRecord():


customers.SelectFirstAsCurrentRecord();

customers.SelectLastAsCurrentRecord();

Simplified code

The Currently Select Record concept allows you to use simple and easy to read code:


customers.Append();

customers.FirstName = "Mike";

customers.LastName = "Stone";


customers.Load(5);

string message = $"Hello {customers.FirstName}.";