Datasets Tables (Reference) provide direct table-level database operations with automatic CRUD functionality and tag mapping. DatasetTable enables:
Tables simplify database interactions by eliminating manual SQL for common operations.
Table of Contents maxLevel 2 minLevel 2 indent 10px exclude Steps style none
Property | Description | Required |
---|---|---|
Name | Unique table identifier (no spaces) | Yes |
DB | Database connection | Yes |
TableName | Actual database table name | Yes |
WhereCondition | Filter clause for operations | No |
Access | Permission level (Read/Insert/ReadWrite/Unrestricted) | Yes |
Mapping | Tag-to-column assignments | No |
MappingDateTime | Time interpretation (UTC/Local) | No |
Description | Documentation text | No |
Level | Permissions | Use Case |
---|---|---|
Read | SELECT only | Viewing data |
Insert | INSERT only | Adding records |
ReadWrite | SELECT, INSERT, UPDATE, DELETE | Full CRUD |
Unrestricted | All operations + ALTER | Development only |
Filter data using SQL WHERE syntax:
sql
Status = 1
Department = 'Production'
Timestamp > '2024-01-01'
sql
BatchID = {Tag.Production/Batch_ID}
Temperature > {Tag.TankFarm/Tank1/Temp}
Operator = '{Tag.Current_Operator}'
sql
Status IN (1, 2, 3)
AND Department = '{Tag.Department}'
AND Timestamp > {Tag.StartDate}
Column | Tag | Usage |
---|---|---|
ID | Tag.RecordID | Primary key |
Name | Tag.ProductName | Display value |
Count | Tag.Quantity | Numeric data |
Status | Tag.Status | State tracking |
csharp
// Trigger select
@Dataset.Table.ProductionTable.Select = true;
// Get all results
DataTable data = @Dataset.Table.ProductionTable.SelectCommand();
// Check row count
int rows = @Dataset.Table.ProductionTable.RowCount;
csharp
// Set values in mapped tags
@Tag.ProductName = "Widget-A";
@Tag.Quantity = 100;
@Tag.Status = 1;
// Execute insert
@Dataset.Table.ProductionTable.Insert = true;
csharp
// Modify mapped tags
@Tag.Quantity = 150;
@Tag.Status = 2;
// Execute update (uses WhereCondition)
@Dataset.Table.ProductionTable.Update = true;
csharp
// Set identifying values
@Tag.RecordID = 12345;
// Execute delete (uses WhereCondition)
@Dataset.Table.ProductionTable.Delete = true;
csharp
public void BatchUpdate()
{
DataTable table = @Dataset.Table.MyTable.SelectCommand();
foreach(DataRow row in table.Rows)
{
row["Status"] = "Processed";
row["ProcessDate"] = DateTime.Now;
}
// Update all modified rows
@Dataset.Table.MyTable.UpdateCommand(table);
}
csharp
// Change filter at runtime
@Dataset.Table.MyTable.WhereCondition =
string.Format("Date = '{0}'", DateTime.Today);
// Execute with new filter
@Dataset.Table.MyTable.Select = true;
csharp
try
{
@Dataset.BeginTransaction();
@Dataset.Table.Table1.Insert = true;
@Dataset.Table.Table2.Update = true;
@Dataset.CommitTransaction();
}
catch
{
@Dataset.RollbackTransaction();
}
Setting | Behavior | Use Case |
---|---|---|
Local | Convert to local time | User displays |
UTC | Keep as UTC | Server operations |
csharp
// Store as UTC, display as local
@Dataset.Table.EventLog.MappingDateTime = "UTC";
// Tag receives UTC, display converts
@Tag.EventTime = // Automatically converted
xml
<DataGrid DataSource="{Dataset.Table.ProductionTable}" />
csharp
// Fill combo with table data
@Display.ComboBox.DataSource =
@Dataset.Table.LookupTable.SelectCommand();
sql
-- Use indexed columns
ID = {Tag.ID} -- Good if ID is indexed
-- Avoid functions on columns
YEAR(Date) = 2024 -- Bad
Date >= '2024-01-01' AND Date < '2025-01-01' -- Good
csharp
// Instead of multiple single updates
for(int i = 0; i < 100; i++)
{
@Tag.ID = i;
@Dataset.Table.MyTable.Update = true; // Slow
}
// Use batch update
DataTable batch = PrepareData();
@Dataset.Table.MyTable.UpdateCommand(batch); // Fast
No data returned:
Insert/Update fails:
Mapping not working:
Performance issues:
Page Tree | ||||
---|---|---|---|---|
|
The Dataset Tables section in the Dataset Module simplifies data table management. Customize structure, relationships, and data types through an intuitive interface that streamlines data handling and promotes efficient data management.
To create and configure a Database Table follow these steps:
Enter a Name and Description for the table.
Info |
---|
The use of spaces is not allowed in the Name. Instead, use underscores. For example: My_Table |
To edit a Dataset Table, double-click the property you wish to edit on the row corresponding to the table you want to modify on the data grid. The table below describes each available property.
Column
Description
Name
The Table's name inside the plataform solution.
DB
Defines the database connected to the Table.
Table Name
The Table's name in the Database you want to access.
WhereCondition
Specify the parameters that will filter the data using SQL syntax. For example: "ColumnName = {tag.tagInt}
".
Access
Defines the access permissions for the table.
Mapping
Click the button with three dots (...) to select the tags that you want to populate with data in the first row of the table with data from specific columns.
MappingDateTime
Specify how the time in Database will be interpreted (UTC or Local), when mapping to DateTimeOffset .NET variables, or to Tags in the application using the Mapping column.
Description
Table's description.
Datasets Table Columns
DatasetTable Properties | |
---|---|
ID | Identifies the unique identifier for the DatasetTable. |
VersionID | Shows the specific version number of the DatasetTable. |
Name | Names the DatasetTable configuration for identification and reference. |
DB | Specifies the database to which the table configuration connects. |
TableName | Defines the name of the database table being accessed or modified. |
WhereCondition | Sets the conditions that filter or limit the rows affected by the operation. |
Access | Specifies the access level required to interact with the table configuration. Read: Grants permission to view or retrieve data from the table. Users can select and read rows based on specified conditions but cannot modify, insert, or delete any data. Insert: Allows users to add new rows to the table. Users can insert data into the table but cannot update, delete, or read existing rows. ReadWrite: Provides full access to the table, allowing users to read, insert, update, and delete data. This option enables complete interaction with the table, covering all CRUD (Create, Read, Update, Delete) operations. Unrestricted: Removes all access limitations, allowing users to perform any action on the table, including reading, inserting, updating, deleting, and even altering the table's structure if necessary. |
Mapping | Links the operation's input or output to tag values or variables. |
DateTimeMode | Specifies how date and time values are handled in the table configuration. Include Local and UTC options. |
Level | Classifies the table configuration within a specific level or hierarchy. |
Category | Groups the table configuration within a specific category for organization. |
LockState | Indicates whether the table configuration is locked and cannot be modified. |
LockOwner | Identifies the owner responsible for locking the table configuration. |
DateCreated | Records the date and time when the table configuration was created. |
DateModified | Records the date and time when the table configuration was last modified. |
Description | Summarizes the purpose and details of the table configuration. |
In this section:
Page Tree | ||||
---|---|---|---|---|
|