Newbie Question ( dataset,dataadapter.datagrid)

  • Thread starter Thread starter Manish
  • Start date Start date
M

Manish

Hi All

I am new to C#.
Can anyone tell me what is the difference between
1.DataAdapter (or is it called SqlDataAdapter)
2.DataSet
3.DataGrid ( i know datagrid is a control)

I am been reading things about them ,but still confused as to how to
effectively use them and what is the relation between them

I appreciate your time
 
The DataAdapter is the class that knows how to extract data from your
datasource. You give it a Connection and command text and then use its Fill
method to populate a DataSet with records. Then set the DataSource property
(I think) to the DataSet and your DataGrid will display the records.

There are hundreds of details that you can tinker with, but that's the basic
operation.
 
Thanks for the reply
so does that mean i can attach any controls other than datagrid to dataset?
and 1 more stupid question ( i guess i am missing the point here).
if datadpater is used to extract the source from the datasource,then why
not use it directly with the controls?

what is the use of dataset?

Thanks for ur patience
 
It's just an extra degree of separation of duties.

The dataadapter is essentially a wrapper around the OleDb drivers. Hence the
generic OleDbDataAdapter and the SqlDataAdapter.

The dataset is the equivalent to a disconnected recordset in previous
versions of ADO. It basically just holds the data in memory.
<---oversimplification
 
Back
Top