How can we check that some changes have been made to dataset since it was loaded? OR How can we cancel all changes done in dataset? OR How do we get values, which are changed in a dataset?

 Posted by ArticlesMaint on 9/17/2009 | Category: ADO.NET Interview questions | Views: 6594

For tracking down changes, Dataset has two methods, which comes as rescue “Get Changes “and “Has Changes”.
Get Changes

Returns dataset, which are changed since it, was loaded, or since Accept changes was executed.
Has Changes

Or abandon all changes since the dataset was loaded use “Reject Changes This property indicates that has any changes been made since the dataset was loaded or accept changes method was executed.

Note: - One of the most misunderstood things about these properties is that it tracks the changes of actual database. That is a fundamental mistake; actually the changes are related to only changes with dataset and have nothing to with changes happening in actual database. As dataset are disconnected and do not know anything about the changes happening in actual database.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response