What is Row State?

Answer

While making your row-level edits, ADO.NET keeps track of the original and proposed versions of all fields. It also monitors which rows have been added to or deleted from the table, and can revert to the original row values if necessary. The Framework accomplishes this by managing various state fields for each row. The main tracking field is the DataRow.RowState property, which uses the following enumerated values:


■■ DataRowState.Detached The default state for any row that has not yet been added to a DataTable.

■■ DataRowState.Added This is the state for rows added to a table when changes to the table have not yet been confirmed. If you use the RejectChanges method on the table, any added rows will be removed immediately.

■■ DataRowState.Unchanged The default state for any row that already appears in a table, but has not been changed since the last call to AcceptChanges. New rows created with the NewRow method use this state.

■■ DataRowState.Deleted Deleted rows aren’t actually removed from the table until you call AcceptChanges. Instead, they are marked for deletion with this state setting. See the following discussion for the difference between “deleted” and “removed” rows.

■■ DataRowState.Modified Any row that has had its fields changed in any way is marked as modified. 

All ado.net Questions

Ask your interview questions on ado-net

Write Your comment or Questions if you want the answers on ado-net from ado-net Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---