There are three most commonly used
methods of Data adapter: -
Fill: - Executes the Select Command to fill the Dataset object with data
from the data source. It can also be used to update (refresh) an existing table
in a Dataset with changes made to the data in the original data source if there
is a primary key in the table in the Dataset.
Fill Schema: - Extracts just the schema for a
table from the data source, and creates an empty table in the DataSet object
with all the correspondingconstraints.
Use of data adapter
Data adapter object acts like a bridge it helps to load the dataset object.
Below is a simple code snippet which shows how the dataadapter object is created
and then using the fill method the dataset object is loaded.
SqlDataAdapter objAdapter = new SqlDataAdapter(objCommand);
DataSet objDataset = new DataSet();
objAdapter.Fill(objDataset);
Above is the ADO.NET
interview questions and see following video on dataset is a connected while
datareader is disconnected: -