what is acceptchanges and reject changes method of data table in ADO.NET?
ACCEPTCHANGES-Method acceptchanges is used to commit all the changes made to the datatable after the last call of acceptchanges method and also change/overwrite the row’s version original value.
At the very first time when data is loaded in to the datatable its entire row has rowstate ‘added’. Then if we make any change in to any row its rowstate property gets changed to ‘modified’. And if we want to make these changes not to rollback then call method ‘acceptchanges’. This method change the property rowstate to the ‘unchanged’ and also its original version value is set to new value.
REJECTCHANGES- method is used to rollback all the changes made to the datatable since last acceptchanges method call.
0 comments:
Post a Comment