DataTable Members
Properties
Contract: IDataTable interface in PocoDataSet.IData library
Implementation: DataTable class in PocoDataSet.Data library
-
Columns
Gets or sets the list of column metadata that defines the table schema.
-
PrimaryKeys
Gets or sets the list of primary key column names for the table.
-
Rows
Gets data rows contained in the table.
-
TableName
Gets or sets the table name.
Indexers
Contract: IDataTable interface in PocoDataSet.IData library
Implementation: DataTable class in PocoDataSet.Data library
-
Indexer
Returns a column by its name.
Methods
Contract: IDataTable interface in PocoDataSet.IData library
Implementation: DataTable class in PocoDataSet.Data library
-
AddColumn
The AddColumn method adds a new column to the table schema.
-
AddColumns
The AddColumns method adds multiple columns to the table by calling AddColumn for each metadata entry.
-
AddLoadedRow
Adds a row that was loaded from a data storage (for example, from SQL Server).
-
AddRow
Adds a row to the table.
-
ContainsColumn
The ContainsColumn method returns a flag indicating whether the table schema contains a column with the specified name.
-
ContainsRow
Gets a flag indicating whether the table contains the specified row instance.
-
EnsureClientKeyColumnExists
The EnsureClientKeyColumnExists method ensures that the table schema contains the special client correlation key column.
-
RemoveAllRows
Removes all rows from the table.
-
RemoveRow
Removes the specified row instance from the table.
-
RemoveRowAt
Removes the row at the specified index.
-
TryGetColumn
Attempts to get column metadata by name without throwing.
Extension Methods
Implementation: classes in PocoDataSet.Extensions library
-
AcceptChanges
Accepts changes for all rows in a table. It is the table-level equivalent of committing the current in-memory state as the new baseline.
A key difference compared to row-level acceptance is how deletions are handled: when a row is in Deleted state, accepting that deletion removes the row from the table.
-
AddColumnsFromInterface
Adds columns to a data table by reflecting over a POCO interface type. It collects the specified interface and its entire inheritance chain, then adds a column for each public instance property.
-
AddNewRow
Creates a new data row, initializes it using the table column metadata, sets its state to Added, inserts it into the table, and returns it to the caller.
-
AsInterface
Returns a live, strongly-typed view of a data row as a POCO interface.
The returned object is a proxy over the underlying data row, so changes made through the interface are immediately reflected in the row,
and changes to the row are visible through the interface.
-
BuildPrimaryKeyIndex
Builds an in-memory primary key index of rows in a table using the table's primary key values.
The returned dictionary maps a compiled primary-key string to the corresponding data row.
-
ClearSelection
Clears the selection state for all rows in a table by setting IDataRow.Selected to false for every row.
This helper is intended for UI-oriented scenarios where a table is used as a selectable list
(for example, when your application allows multi-row selection and you want to clear all selections in one operation).
-
Clone
Creates a new data table instance and copies the schema and rows from an existing table.
-
CloneColumnsFrom
Clones column metadata from one table into another table. For every column in the source table,
it creates a new ColumnMetadata instance, copies all metadata properties, and adds the cloned column metadata to the target table.
-
CloneRowsFrom
Clones all rows from a source table into a destination (cloned) table. It creates a new data row instance for each source row with copied data and adds it to the destination table.
-
ContainsColumn
Determines whether a table contains a column with the specified name. The comparison is performed in a case-insensitive manner.
-
CopyFromPocoList
Copies data from POCO list into data table by adding to table a new row for every item in the list.
-
DeleteRow
Deletes rows in Unchanged or Modified state
Removes rows in Added state from table
Does nothing if rows in Deleted or Detached state
-
DeleteRowAt
Deletes a row from an data table by its zero-based index.
-
EnsureExistingRowsHaveColumn
The EnsureExistingRowsHaveColumn helper ensures that every existing row internal value dictionary contains an entry for a newly added column.
-
GetFieldValue
Reads a field value from a table row and returns it as a strongly typed value.
It is a table-level convenience wrapper that validates the row index and column name (case insensitive)
before delegating the actual value extraction to DataRowExtensions.GetDataFieldValue<T>
-
RejectChanges
Rejects all pending changes in a table and reverts the table to the last accepted state.
Rows in Added or Detached states removed the row from the table
Rows in Deleted or Modified state are restored to original values and row state
Method does nothing if rows are in Unchanged state.
-
ToArray
Converts all rows in a data table into array of elements.
-
ToDetachedArray
Converts all rows of data table into an array of detached interface objects.
Each returned object represents a snapshot of the row values at the moment the method is called.
-
ToDetachedList
Converts all rows of data table into an list of detached interface objects.
Each returned object represents a snapshot of the row values at the moment the method is called.
-
ToList
Converts all rows in a data table into list of elements.
-
TryFindRowByPrimaryKey
The TryFindRowByPrimaryKey extension method searches a table for a row whose primary key columns match specified values.
It performs a linear scan of dataTable.Rows and supports both single-column and composite primary keys.
Table of Content
POCO DataSet
API References
POCO DataSet Types
Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the
Creative Commons Attribution 4.0 International License (CC BY 4.0).
Code examples are provided under the MIT License.
You are free to share and adapt the material provided that appropriate
credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness
or suitability of the information and are not responsible for any damages
resulting from its use.