Overview
DataRow DataTable myDataTable.Add(row: object)
DataRow DataTable myDataTable.Add(fn: (row: DataRow) => void)
...
Function instance to set row values.
Example
...
Code Block | ||
---|---|---|
| ||
var table = $Database.Empty({
Parameters : {
TargetSchema : 'HR',
TargetTable : 'Groups'
}
});
table.Add({
id : Script.NewId(),
name : 'Employee'
});
table.Save(); |
Example
...
language | js |
---|
...
.
...
Example
Create a new row from object
Code Block | ||
---|---|---|
| ||
var table = $Database.Empty({ Parameters : { TargetSchema : 'HR', TargetTable : 'Groups' } }); table.Add({ id : Script.NewId(), name : 'Employee' }); table.Save(); |
Example
...
Code Block | ||
---|---|---|
| ||
var table = $Database.Empty({
Parameters : {
TargetSchema : 'HR',
TargetTable : 'Groups'
}
});
table.Add(function () {
this.Id = id;
this.Name = 'Administrators-2';
});
table.Save(); |
Examples
...
language | js |
---|
...
Create a new row with mapper function
Code Block | ||
---|---|---|
| ||
var table = $Database.Empty({ Parameters : { TargetSchema : 'HR', TargetTable : 'Groups' } }); table.Add(function () { this.Id = id; this.Name = 'Administrators-2'; }); table.Save(); |