Slide 3 of 2609/20/13
DataAdapter class forms the base class for all data adapters. ADO.NET implements various
data adapters. These data adapters are inherited from the DbDataAdapter class.
The SqlDataAdapter serves as a link between a DataSet and the SQL Server database for
retrieving and saving data.
The SqlDataAdapter class exists in the System.Data.SqlClient namespace.
Slide 4 of 2609/20/13
Slide 5 of 2609/20/13
The SqlDataReader class is used to read data from a SQL Server database. It exists in the
For retrieving data from the database:
+ First connect to SQL Server database using SqlConnection.
+ Call the ExecuteReader() method of the SqlCommand class to retrieve records from the
+ Read the records by executing the Read() method.
Slide 6 of 2609/20/13
Slide 7 of 2609/20/13
Slide 8 of 2609/20/13
Slide 9 of 2609/20/13
DataSet object can either be typed or untyped. A typed DataSet is a class derived from the
Slide 10 of 2609/20/13
An untyped dataset does not have a built-in schema
Slide 11 of 2609/20/13
Fetching XML Data Using Datasets
DataSet objects can fetch data from an XML file.
+ ReadXml() method contains the path of the XML file. This method reads the XML data
including the schema of the XML file.
+ Can make changes to the XML data in the DataSet and update
the changes to the XML source file using the WriteXml() method.
Slide 12 of 2609/20/13
Slide 13 of 2609/20/13
A DataTable class represents a table in the DataSet. It is used to store data from a data
source. It contains a set of rows and columns to organize data in a tabular format.
Slide 14 of 2609/20/13
The DataTableCollection class is a collection of tables for a DataSet. It enables you to
access the collection of DataTable objects and navigate through the tables in the DataSet.
Slide 15 of 2609/20/13
Slide 16 of 2609/20/13
Setting Relation between Tables
Slide 17 of 2609/20/13
The DataColumn class represents a column in a DataTable.
Slide 18 of 2609/20/13
The DataRow class represents a row in a DataTable.