Last post Jul 05, 2019 09:50 AM by samwu
Jul 05, 2019 07:52 AM|gogoalshop|LINK
What is the difference between DataRow state and DataRow version in ADO.NET?
Jul 05, 2019 09:50 AM|samwu|LINK
1.Row state indicates the status of a row, it has 5 kinds, respectively is UnChanged, Added, Modified, does, Detached. The newly created row (DataRow object) is in the Detached state. After it is added to the DataTable object, the state of the DataRow object
becomes the Added state. If the DataRow has been Modified, the line is in the Modified state. If the DataRow object is removed from the table using the Remove method, or if the row is removed using the Delete method and the AcceptChanged method, the row is
in the Detached state.
2.Row versions maintain the values stored in a row as it is modified, including current, original, and default values. There are four different versions of DataRow version, namely Current, Original, proposed and default. You can pass the DataRowVersion parameter
through a column reference to see different DataRow versions.the AcceptChanged method is called, all rows in the deleted state will be in the Detached state, ie removed. The rest of the rows will change to the Unchanged state, and the value in the Original
version will be rewritten to the value of the current row version.
More information you can refer to this link:Row States and Row Versions