SIGN UP MEMBER LOGIN:    
Blog

Public methods of DbDataSet class

Posted by Monika Arora Blogs | SQLite Feb 03, 2012
In this blog, I have discussed some of the public methods of DbDataSet class which are AcceptChanges, BeginInit, Clear, Clone, Copy etc.

Some of the public methods of DbDataSet class are as follows:

AcceptChanges:
It makes permanent all of the changes that are made to a current DataSet since the previous time Accept Changes was called. System.Data.DataSet is the base class for this method.

BeginInit:
DataSet can be used on a form or it can be used by some other component. But you also need to initialize it at runtime which can be done by using "BeginInit" method. This method starts the initialization of DataSet. The base class for it is System.Data.DataSet.

Clear:
It removes every content from DbDataSet which includes rows in all tables.

Clone:
It makes a copy of the structure of the DbDataSet which includes all schemas of DbDataTable, relations, and constraints. But it does not make a copy of the content.

Copy:
It works like a Clone method. The difference is that it also copies the content along with the structure for the DataSet. The base class for this method is System.Data.DataSet.

CreateDataTable:
This method generates a new table in the DbDataSet.

Update:
It runs the particular commands for removing, adding or modifying rows in the data source.

WriteXml:
This method is overloaded and writes the present data for the DataSet through the use of the given Stream. The base class for it is System.Data.DataSet.

WriteXmlSchema:
This method is overloaded. It writes the structure of DataSet in the form of an XML schema through the use of the given object of Stream. The base class of this is also the same as WriteXml method.

RejectChanges:
This method rollbacks all the modifications done to the DataSet from the day it was created or the last time "Accept Changes" was called. The base class of this method is also same.

ReadXml:
It is overloaded method and reads schema of XML and data into the DbDataSet.

ReadXmlSchema:
It is overloaded and it reads the schema of XML from the given Stream into the DataSet.

HasChanges:
It is overloaded method. It obtains a value that shows whether the DataSet has modifications which can contain new, deleted, or modified rows. The base class is the same as that of other methods.

Reset:
It again sets the DataSet to its previous state. Derived classes are required to override Reset so that they can again store the DataSet to its previous state.

share this blog :
post comment