Rows Property

Overview

Gets a read-only view of the data rows contained in the table.

Namespace and Assembly

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

Declaration

/// <summary>
/// Gets a read-only view of the data rows contained in the table.
/// </summary>
public IReadOnlyList<IDataRow> Rows
{
    get;
}

Usage Example

// 1. Create an empty data set and a table
IDataSet dataSet = DataSetFactory.CreateDataSet();
IDataTable employeeTable = dataSet.AddNewTable("Employee");
employeeTable.AddColumn("Id", DataTypeNames.INT32);
employeeTable.AddColumn("FirstName", DataTypeNames.STRING);
employeeTable.AddColumn("LastName", DataTypeNames.STRING);

// 2. Add several rows to Employee data table
IDataRow employeeDataRow1 = employeeTable.AddNewRow();
employeeDataRow1["Id"] = 1;
employeeDataRow1["FirstName"] = "John";
employeeDataRow1["LastName"] = "Doe";

IDataRow employeeDataRow2 = employeeTable.AddNewRow();
employeeDataRow2["Id"] = 2;
employeeDataRow2["FirstName"] = "Sara";
employeeDataRow2["LastName"] = "Gor";

// 3. Get a read-only view of the data rows contained in the table
// Observe that the list contains two data rows that we have added to the table in step 2
IReadOnlyList<IDataRow> employeeDataRows = employeeTable.Rows;

 

Table of Content POCO DataSet API References POCO DataSet Types DataTable 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.