Scenario: A user wants to delete a record from a dataset, but you want to ensure that the deletion is not permanent until the user confirms. What ADO.NET functionality can help you achieve this?

  • Implementing a custom rollback mechanism
  • Using DataAdapter's DeleteCommand property
  • Using DataAdapter's Fill and Update methods
  • Using DataTable's RejectChanges method
DataTable's RejectChanges method allows reverting changes made to a DataTable since it was loaded or since the last AcceptChanges call. By calling this method, you can undo deletion of records until changes are permanently saved to the database. This provides a safety net for users before committing irreversible changes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *