Examining Row State

Every row has a RowState property that can tell you what has been done to the data within that row. A RowState can be one of five values: Added, Deleted, Detached, Modified, and Unchanged. The Detached row state is given to a row that has been created using the table's NewRow method but has not officially been added to that table using the Rows collection's Add method. This row exists in the table in a detached state until you add it to the table, at which time the RowState is changed to Added. As you edit the rows in your DataSet, those rows RowState values change accordingly. Once you execute an AcceptChange that commits the changes made to your rows, their RowStates are reset to their default value, Unchanged.

0 0

Post a comment