StrataFrame Forum

Set rowstate

http://forum.strataframe.net/Topic7275.aspx

By Chan - 3/2/2007

Hi,
I created datatable act as temporary "cursor". My program will loop thru this datatable and check for rowstate to determine whether insert/update/delete record from underlying table.

How could I retain content of datatable.rows but set their rowstate to unchanged?

Thank you

By StrataFrame Team - 3/2/2007

On a DataRow like that, you have two options: you can call .RejectChanges() on the row, which will undo any changes to the data and mark the record as unchanged, or you can call .AcceptChanges() which will accept any changes you have made (retaining the data) and mark the row as unchanged.

Along the same line, if you call .SetAdded(), .SetModified() and I believe .SetDeleted() on the row, you can move it from an unchanged state to the corresponding state.