Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
2.80/5 (5 votes)
See more:
What is the different between dataset and data table.with suitable examples
Posted
Comments
Albin Abel 14-Mar-11 6:48am    
dataset is container of datatables. It is like your team and you in that. What you mean by difference? Then it is like what is difference between your team and you
Sergey Alexandrovich Kryukov 14-Mar-11 15:21pm    
The questions in the format "what's the different between {0} and {1}?" can not be correct in principle. In my opinion, they should not be answered.
--SA
Member 14107736 1-Jun-20 6:29am    
nice

A DataSet holds one or more DataTables.

Example 1:
DataTable dt = new DataTable();
DataSet ds = new DataSet();
ds.Tables.Add(dt);


Example 2:
DataTable dt1 = new DataTable();
DataTable dt2 = new DataTable();
DataSet ds = new DataSet();
ds.Tables.Add(dt1);
ds.Tables.Add(dt2);


If you want any more, then do your own homework.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Mar-11 15:22pm    
Griff, I did not vote this time. Why putting yourself in cumbersome position answering questions which are incorrect by definition? Please see my comment to the Question.
--SA
Member 11382635 3-Mar-15 23:13pm    
SAKryukov, How do you have time to become an expert contributor when you waste your time justifying to everyone how smart you are...thank you Griff.
Member 10470965 29-May-14 10:30am    
Thanks for taking the time to answer the question clearly and precisely. Not everyone who comes here seeking wisdom and knowledge is an expert in programming C#. It would be a shame to cut people like myself from those of you gentle people who have vast amounts knowledge and experience. We, the unwashed, are looking for answers to what may seem like trivial questions. That is how we got here in the first place. Google is a our friend, most of the time.
OriginalGriff 29-May-14 10:47am    
You're welcome!
One line:
DataSet is collection of DataTables.

Above line itself is more than enough to explain what are they and where to use. Right?

In case not, then:
DataTable = A table with rows and columns
DataSet = A set with datatables. Can hold one or more Datatables in it. A container of datatables. Not just it, in Dataset you can have relations between tables too.


Refer to the documentation on MSDN to get more in detail:
Take a look here: DataSet[^] and DataTable[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Mar-11 15:23pm    
Sandeep, I did not vote this time. Why putting yourself in cumbersome position answering questions which are incorrect by definition? Please see my comment to the Question.
--SA
Member 11382635 3-Mar-15 23:14pm    
SAKryukov, How do you have time to become an expert contributor when you waste your time justifying to everyone how smart you are...thank you Sandeep.
Sergey Alexandrovich Kryukov 3-Mar-15 23:18pm    
This post is based on some wrong assumptions. Any other ideas?
—SA
zablab 1-Jan-15 20:58pm    
Great job Sandeep!
::::Dataset:::

1) first of all Dataset is the disconnected architecture.

2) DataSet is a Class For storing a dataTable in it.

3) DataSet is a collection of DataTables which is having multiple rows and columns

4) DataSet contains Multiple Tables in it .. DataTable does't

5) DataSet is More flexible then DataTable

::::DataTable:::

1) DataTable also a Class Which contains multiple rows and columns in it..

2) DataTable Stores only one table in it.

3) DataTable have a GetTable() method for getting table in database.

4) DataTable is less flexible then DataSet


Thank You
 
Share this answer
 
v2
Comments
Deepu S Nair 13-May-15 5:22am    
Did you notice that question is nearly 4 years old.It will attract downvoting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900