Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The Datasets Namespace exposes properties and methods from the .NET objects used by the Historian module execution. You can use these properties and methods on your Displays or to create Scripts and Alarms.

To learn about the basic concepts of namespaces and objects, you can refer to Objects and Namespaces.

Introduction to Datasets module

The Dataset Module is designed for data exchange with SQL databases and text files from a diverse set of sources. This module offers compatibility with a wide array of database technologies, including ADO.NET, ODBC, OleDB, and native interfaces, providing straightforward configuration with prominent databases such as SQL Server, Oracle, SQLite, and PostgreSQL.

Features include multi-threaded concurrent connections for efficient data handling, a dedicated SQLite editor for streamlined database management, and an intuitive visual query builder that simplifies the process of query creation and manipulation. Moreover, the Dataset module is equipped to integrate real-time tags within query strings, enhancing the dynamism of data interaction. It can also manage files and recipes in ASCII, Unicode, or XML formats, broadening its applicability across different data types. 

On this page:

Table of Contents
maxLevel3
stylenone


Dataset

Datasets Runtime Attributes

The Dataset namespace exposes properties and methods of the .NET objects used by the Dataset module execution.

Below is a table describing same \ from the Datasets Namespace. Access the Datasets Namespace page for a complete list of available options.

For more information on namespaces and objects, go to Objects and Attributes.

Dataset module Properties examples

Property

Type

Description

Example

CursorIndex

Integer

Represents the current position of a cursor within the result set of a query. It is an integer value that indicates the row number in the result set that the cursor points to, with the first row having an index of 0. The cursor can be used to navigate through the result set, allowing you to read, update, or delete rows of data.

Dataset.Query.QueryName.CursorIndex + 1

OpenStatusMessage

String

Provides a human-readable message describing the current state of the database connection. This can be useful for monitoring the connection status, diagnosing issues, or displaying the connection status to users in a user-friendly format.

Dataset.DB.DatabaseName.OpenStatusMessage

ConnectionString

String

Used to store the necessary information for establishing a connection to a database. It is a string value containing details such as server name, database name, authentication credentials, and other relevant parameters.

Dataset.DB.ProviderName.ConnectionString


Monitoring Database Connection Status

Monitoring Database Connections is an essential aspect of maintaining a reliable operation of the solution. 

That cab be accomplish using the Dataset Namespace properties. 

Examples (Replace YourDatabaseName and YourQueryName to object you want to test)

This section describes only some commonly used properties, for the full list properties and methods, go to the Namespaces Reference.

1. IsStarted: This property indicates if the dataset is started, meaning it has been initialized and connected to the database. You can use it to check if the dataset is currently running. 

bool isStarted = @Dataset.DB.YourDatabaseName.IsStarted;

2. Query Execution Time: You can measure the execution time of a query by checking the time before and after executing the query. 

DateTime startTime = DateTime.Now;
@Dataset.Query.YourQueryName.SelectCommand();
DateTime endTime = DateTime.Now;
TimeSpan executionTime = endTime - startTime;

3. ConnectionString: You can check the connection string used for the database to ensure it is configured correctly.
Example

string connectionString = @Dataset.DB.YourDatabaseName.ConnectionString;



In this section:

Page Tree
root@selfDatasets Advanced Topics
spacesV10