DataRowState Property

Overview

The DataRowState property allows you to get the state of a row. The DataRowState property cannot be set directly by application code. State transitions are managed internally by the POCO DataSet framework based on row operations (Add, Modify, Delete, AcceptChanges, RejectChanges).

DataRowState Values

The DataRowState property reflects the lifecycle state of a row within a IDataTable. The following values are supported:

Namespace and Assembly

Namespace: PocoDataSet.Data
Assembly: PocoDataSet.Data.dll

Usage Example

// 1. Create an empty data set
IDataSet dataSet = DataSetFactory.CreateDataSet();

// 2. Create an empty data table
IDataTable departmentDataTable = dataSet.AddNewTable("Department");
departmentDataTable.AddColumn("Id", DataTypeNames.INT32);
departmentDataTable.AddColumn("Name", DataTypeNames.STRING);

// 3. Create a new row by AddNewRow method on data table, the row state is Added
IDataRow departmentDataRow = departmentDataTable.AddNewRow();

// 4. Get the state of the row by using DataRowState property, expected Added
DataRowState dataRowState = departmentDataRow.DataRowState;

 

Table of Content POCO DataSet API References POCO DataSet Types DataRow Members

 


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.