Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

dataset and datatable in vb.net

can someone clarify  the difference between Dataset and DataTable?

thanks
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Hi jskfan,

a DataTable contains the result of a SELECT query.

A DataSet contains DataTables, DataRelations.

Cheers!
SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Because I have seen some codes like this one, I hope I am correct.

sqldataAdpater.fill(dataset1.datatable1)

I have also  seen :

SqldataAdapter.fill(dataset1)


if you notice 2 different ways.

>>SqldataAdapter.fill(dataset1)

Adds or refreshes rows in the DataSet to match those in the data source using the DataSet name, and creates a DataTable named "Table".  

>>sqldataAdpater.fill(dataset1.datatable1)

Adds or refreshes rows in a DataTable to match those in the data source using the DataTable name.  
Avatar of jskfan

ASKER

I am raising the points to 400 pts

emoreau : Can you please rephrase your statement into an example please?

>>SqldataAdapter.fill(dataset1)

The dataset named dataset1 is filled with a datatable named "Table" containing the result of the query SqlDataAdapter.

this is the regulare syntax.


>>sqldataAdpater.fill(dataset1.datatable1)

a specific datatable is filled in the dataset.
have you read the help file on these 2 syntax? do you have any particular problem?
Avatar of jskfan

ASKER

Let me see if I understood the difference

<<<sqldataAdpater.fill(dataset1.datatable1)>>>>

You use this statement above to fill dataset1 with a specific datatable named datatable1. Correct?


SqldataAdapter.fill(dataset1)

You use this statement above to fill dataset1 with a any datatable used in the SqlDataAdapter(s) it could be one or more  . Correct?

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lp_meteora
lp_meteora

A DataSet is an in-memory representation of one or multiple DataTables, relations, and constraints. (Applied ADO.NET)