ClearRows Method
The method ClearRows is a wrapper around the Clear method.
The Clear method is kept for backward compatibility with ADO.Net DataSet naming convention,
the major disadvantage of which is luck of clarity whether it clears schema or data.
The ClearRows method name clearly indicates that it only clears data (rows) while keeping the schema intact.
/// <summary>
/// Alias for Clear method
/// Clears all rows from all tables in the data set.
/// Keeps schema (tables and columns) intact.
/// </summary>
/// <param name="observableDataSet">Observable data set</param>
public static void ClearRows(this IObservableDataSet? observableDataSet)
Namespace: PocoDataSet.ObservableExtensions
Assembly: PocoDataSet.ObservableExtensions.dll
// 1. Create observable data set
IObservableDataSet observableDataSet = new ObservableDataSet();
// 2. Create Department observable data table with one row
IObservableDataTable departmentObservableDataTable = observableDataSet.AddNewTable("Department");
departmentObservableDataTable.AddColumn("Id", DataTypeNames.INT32);
departmentObservableDataTable.AddColumn("Name", DataTypeNames.STRING);
IObservableDataRow departmentObservableDataRow = departmentObservableDataTable.AddNewRow();
// 3. Call ClearRows method and observe that Department observable data table has no rows anymore
observableDataSet.ClearRows();
Table of Content POCO DataSet
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.