In this article I will explain about Data Row in ADO.Net.
A DataRow represent a row of data in data table. You add data to the data table using DataRow object. A DataRowCollection object represents a collection of data rows of a data table. You use DataTable's NewRow method to return a DataRow object of data table, add values to the data row and add a row to the data Table again by using DataRowCollection's Add method.Before adding rows to a data table, I'll discuss the DataRow class properties and methods. Table 1 describes DataRow class properties, and Table 2 describes the DataRow class methods.Table 1: The Data Row Class properties
PROPERTY
DESCRIPITION
Item
Represents an item of a row
ItemArray
Represents all values in a row
RowState
Indicates the current state of a row
Table
Returns the DataTable to which this row is attached
METHOD
DESCRIPTION
AcceptChanges
Comments all the changes made to this row
BeginEdit
Starts an edit operation on a row
CancelEdit
Cancels the current edit on a row
Delete
Deletes a DataRow
EndEdit
Ends the current edit on a row
GetChildRows
Returns child rows of a DataRow
GetParentRows
Returns parent rows of a DataRow
RejectsChanges
Rejects all the changes made since last AcceptChanges
MEMBER
Added
Row has been added and AcceptChanges has not been called.
Deleted
Row was deleted using the Deleted method.
Detached
Row was created but deleted before it was added to the collection.
Modified
Row has been modified, but AcceptChanges is not called yet.
Unchanged
Row has not changed since last AcceptChanges was called.
Printing in C# Made Easy