Dataset has “AcceptChanges” method, which commits all the changes since last time “Acceptchanges” has been executed.
How can we check which rows have changed since dataset was loaded?
For tracking down changes, Dataset has two methods, which comes to rescue “Get Changes “and “Has Changes”.
Returns dataset, which are changed since it, was loaded, or since Accept changes was executed.
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.
How can we add/remove row is in “Data Table” object of “Dataset”?
“Data table” provides “NewRow” method to add new row to “Data Table”. “Data Table” has “DataRowCollection” object that has all rows in a “Data Table” object. Following are the methods provided by “DataRowCollection” object:-
Adds a new row in Data Table
How can we load multiple tables in a Dataset?
objCommand.CommandText = "Table1"
objCommand.CommandText = "Table2"
Above is a sample code, which shows how to load multiple “Data Table” objects in one “Dataset” object. Sample code shows two tables “Table1” and “Table2” in object ObjDataSet.
In order to refer “Table1” Data Table, use Tables collection of Datasets and the Default view object will give you the necessary output.
lstdata.DataSource = objDataSet.Tables("Table1").DefaultView
How can we add relation between tables in a Dataset?
Dim objRelation As DataRelation
See the following video on Dataset is a disconnect while datareader is connected: -
Click and see here for more step by step training in ADO.NET