DataSet Members
Properties
Contract: IDataSet interface in PocoDataSet.IData library
Implementation: DataSet class in PocoDataSet.Data library
-
Name
Optional dataset name. This is commonly used for diagnostics, UI captions, or integration scenarios.
-
Relations
Collection of IDataRelation instances describing parent / child relationships between tables.
-
Tables
Dictionary of IDataTable instances keyed by table name.
Indexers
Contract: IDataSet interface in PocoDataSet.IData library
Implementation: DataSet class in PocoDataSet.Data library
-
Indexer
Returns a table by its name.
Methods
Contract: IDataSet interface in PocoDataSet.IData library
Implementation: DataSet class in PocoDataSet.Data library
-
AddRelation
Adds relation between parent and child tables in a data set.
-
AddTable
Adds provided data table to a data set if a table with the same name does not already exist.
-
RemoveRelation
Removes relation between parent and child tables from a data set.
-
RemoveTable
Removes a specific table from an data set by name.
-
TryGetTable
Attempts to retrieve a table from an data set by name, returning a boolean to indicate success or failure.
Extension Methods
Implementation: classes in PocoDataSet.Extensions library
-
AcceptChanges
Accepts changes across the entire data set. Commonly used after a successful save operation,
or after you decide that the current in-memory state should be treated as the new baseline (no pending local changes).
-
AddNewTable
Adds a new data table to a data set.
-
AddNewTableFromPocoInterface
Adds a new data table to a data set, using the properties of a specified POCO interface type to define the table schema.
-
AddRow
Adds an existing IDataRow instance to a table inside an IDataSet.
It is intended for cases where the row must be created and populated before it is inserted into the table.
-
AsInterface
Returns a live, strongly-typed view of a data row as a POCO interface.
Any change made through the returned interface is immediately propagated to the underlying data row,
and any change in the row is visible through the interface.
This method is a cornerstone of the POCO DataSet philosophy of "programming to interfaces".
It allows application code to work with domain-oriented interfaces instead of dictionary-style row access while still preserving full change tracking.
-
Clear
Removes all rows from every table in an data set. It does not remove tables, columns, or other schema metadata.
Use this method when you want to reuse the same data set instance and schema but discard all rows.
-
ClearRows
The CleaRows method is intended to be an alias for Clear, providing an alternate name for clearing all rows from all tables while keeping the data set schema intact.
-
ContainsRelation
The ContainsRelation method checks whether IDataSet.Relations contains a relation with the specified name.
It is typically used to guard code that depends on a relation existing (navigation, validation, diagnostics).
-
CreateChangeset
Creates a new data set that contains only the rows that have been changed in the current data set.
A row is considered "changed" when its DataRowState is Added, Modified, or Deleted.
The returned data set (the "changeset") contains only the tables that have at least one changed row.
Each included table is created with the same column metadata as the source table, and then the changed rows are copied into the changeset.
-
DoPostSaveMerge
The DoPostSaveMerge method applies a post-save server response (a changeset) to the current data set.
A typical use case is applying server-assigned values such as identity primary keys and concurrency tokens (for example, RowVersion) back to newly added rows on the client.
-
DoRefreshMergeIfNoChangesExist
The DoRefreshMergeIfNoChangesExist method refreshes the current data set from a server snapshot only when the current data set contains no pending local changes.
If any row in any merged table is not Unchanged, the merge throws an InvalidOperationException to protect local work.
-
DoRefreshMergePreservingLocalChanges
The DoRefreshMergePreservingLocalChanges method refreshes the current data set from a server snapshot while preserving local pending changes.
In this strategy, rows in Added, Modified, or Deleted state are never overwritten by refreshed values.
-
DoReplaceMerge
The DoReplaceMerge method performs a destructive reload: it clears all rows from the current data set tables and re-adds rows from the refreshed data set as Unchanged.
-
EnsureRelationsValid
The EnsureRelationsValid method validates referential integrity based on the relations registered in IDataSet.Relations.
If at least one violation is found (for example, a child row references a missing parent row), the method throws an InvalidOperationException with a readable diagnostic message.
-
GetChildRows
The GetChildRows method navigates a relation from a parent row to its child rows.
It uses the relation metadata stored in IDataSet.Relations and matches child rows based on key column values.
-
GetFieldValue
Retrieves a strongly typed value from a specific table, row, and column (case insensitive) within an data set.
This method is useful when you need to read a single value without directly navigating tables and rows or casting from object.
-
MergeWith
The MergeWith method is deprecated and kept for backward compatibility. Please use DoPostSaveMerge, DoRefreshMergeIfNoChangesExist, DoRefreshMergePreservingLocalChanges or DoReplaceMerge methods instead, which provide more explicit merge semantics.
-
PocoListToDataTable
Creates a new table in an data set and populates it from a list of POCO items.
-
RejectChanges
Rolls back changes across the entire data set. Commonly used when you want to discard pending local changes and revert to the last accepted state.
-
RemoveRow
Removes a specific row from a table in an data set by locating the table by name and delegating the row removal to IDataTable.RemoveRow method.
-
TryGetParentRow
The TryGetParentRow method navigates a relation from a child row to its parent row.
It returns true when a matching parent row is found, otherwise returns false and sets parentRow to null.
-
UpdateFieldValue
Updates a single field value in an data set by addressing the target data field using table name, row index, and column name.
-
ValidateRelations
The ValidateRelations extension method validates referential integrity using the relation metadata stored in IDataSet.Relations.
ValidateRelations is the non-throwing method: it returns a list of violations you can inspect and decide how to handle.
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.