AFTable.InitializeDataTable Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static bool InitializeDataTable( AFTable table, DataTable dataTable )
Public Shared Function InitializeDataTable ( table As AFTable, dataTable As DataTable ) As Boolean Dim table As AFTable Dim dataTable As DataTable Dim returnValue As Boolean returnValue = AFTable.InitializeDataTable(table, dataTable)
public: static bool InitializeDataTable( AFTable^ table, DataTable^ dataTable )
static member InitializeDataTable : table : AFTable * dataTable : DataTable -> bool
Parameters
- table
- Type: OSIsoft.AF.AssetAFTable
The AFTable that the dataTable will be initialized to be used for setting its Table property. - dataTable
- Type: System.DataDataTable
The DataTable that will be initialized to be used with the specified table.
Return Value
Type: BooleanReturns if the dataTable was updated by calling this method. Otherwise, is returned.
Remarks
This helper can be used to initialize a DataTable that will be used to set the Table property. It will ensure that any DateTime columns of the DataTable have their DateTimeMode set correctly based upon the ConvertToLocalTime and TimeZone settings of the AFTable. This method should be called after the table's columns have been defined and before any rows have been added.
| The Locale of the dataTable should normally be set to CurrentCulture. |