Getting the next primary key
AutoIncrement.GetNextValue()
For getting the next available number for an entry, use âGetNextValueâ, which can be found in TimeLine.Business.AutoIncrement.
GenerateAutoIncrementPrimaryKeys(string columnName)
The GenerateAutoIncrementPrimaryKeys method generates autoincremented primary keys for all DataRows with status "EditingNew" in the given DataTable. It works by using the AutoIncrement class to request a batch of primary keys equal to the number of "EditingNew" rows, then assigning incremental values to each of those rows.
If the database table contains a column with unique index, the system recognizes that column to be part of the primary key. In order to solve this issue, the name of the column containing the actual primary key must be given as an argument.
Optionally, an action expression can be passed as a parameter, to set extra information in the rows that will be created in the database (such as synchronizing a hybrid value, setting created_at, etc.)
Last updated