-->

21 February 2020

ADO.NET DataSet

  Asp.Net CS By Example       21 February 2020
 ADO.NET DataSet 

 In this post we are exploring more about DataSet class. We use an object of the DataSet class to represent a local copy of the information stored in a database. We can also use a DataSet object to represent XML data. Below table listed some of the DataSet properties.

DataSet Properties:

Sr.No Property Type Description
1) CaseSensitive bool Gets or sets a bool value that indicates whether string comparisons within DataTable objects are case sensitive.
2) DataSetName string Gets or sets the name of the current DataSet object.
3) EnforceConstraints CommandType Gets or sets a value that indicates how the CommandText property is to be interpreted. Typically, the only time we’ll need to set this property is when calling a stored procedure, in which case we set it to CommandType.StoredProcedure.
4) Connection bool Gets or sets a bool value that indicates whether constraint rules are followed when updating information in the DataSet object.
5) HasErrors bool Gets a bool value that indicates whether there are errors in any of the rows in the tables of the DataSet object.
6) Relations DataRelationCollection Gets the collection of relations (DataRelationCollection) that allows navigation from a parent table to a child table. A DataRelationCollection consists of DataRelation objects.
7) Tables DataTableCollection Gets the collection of tables (DataTableCollection) that contains the DataTable objects stored in the DataSet.

OracleCommand Methods:

Sr.No Method Return Type Description
1) AcceptChanges() void Commits all the changes made to the DataSet object since it was loaded or since the last time the AcceptChanges() method was called.
2) Clear() void Removes all rows from all tables in the DataSet object.
3) Clone() DataSet Clones the structure of the DataSet object and returns that clone. The clone contains all the schemas, relations, and constraints.
4) GetChanges() DataSet Gets a copy of all the changes made to the DataSet object since it was last loaded or since the last time the AcceptChanges() method was called.
5) GetXml() string Returns the XML representation of the data stored in the DataSet object.
6) GetXmlSchema() string Returns the XML representation of the schema for the DataSet object.
7) HasChanges() bool Returns a bool value that indicates whether the DataSet object has changes that haven’t been committed.
8) Merge() void Merges this DataSet with another specified DataSet object.
9) ReadXml() XmlReadMode Loads the data from an XML file into the DataSet object.
10) ReadXmlSchema() void Loads a schema from an XML file into the DataSet object.
11) RejectChanges() void Undoes all the changes made to the DataSet object since it was created or since the last time the AcceptChanges() method was called.
12) Reset() void Resets the DataSet object to its original state.
13) WriteXml() void Writes the data from the DataSet object out to an XML file.
14) WriteXmlSchema() void Writes the schema of the DataSet object out to an XML file.
logoblog

Thanks for reading ADO.NET DataSet

Previous
« Prev Post

No comments:

Post a Comment

Please do not enter any spam link in the comment box.