What are the commonly used methods of Dataadapter in ADO.NET?Dataadapter
has several methods associated with it.
Most commonly used methods among them are listed below: Fill:
Fill method is used to fetch records from the database and update them
into the datatables of dataset. Uses SelectCommand for execution. Syntax
for Fill method is : sampleAdapter.Fill(employee,Employee); FillSchema:
FillSchema method is used to create an empty table in dataset containing
the same schema as that of a specific table in the database. Constraints
of the corresponding database table is also copied and reflected in the
datatable of dataset. Uses SelectCommand for execution but copies only
the schema of the table and not the data. Syntax for this method is shown
below: Update:
Manipulated records of the dataset are updated back in the database using
this method. Records that are inserted, updated and deleted from the dataset
are pushed into the database using this method. Uses InsertCommand or
UpdateCommand or DeleteCommand for the above mentioned purpose. Syntax
for Update method is shown below: Dispose:
This method is used to release all resources used by the dataadapter.
Here is the syntax:
|