Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ADO.NET
My question is why do we use datatable when we have dataset which provides same functionality like datatable . Also its functionality is very vast(dataset). we can bind dataset to gridview than why to use datatable. Also we say that datatable,dataset,datareader represents an inmemory database so does it mean that that database tables store in our pc (physical disc) . What if we dont have sql server on our pc and using an application(web) that sends us tables(say 4)from physical storage database than in what format do the tables store.
Posted 20-Aug-13 19:08pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

DataSet is a collection of DataTables, so they are not the same thing.
 
Yes you can use a DataSet as an in-memory database on your clients, however it is :
* not multiuser
* slow on loading
* can be memory hogging
  Permalink  
Comments
Rohan Leuva at 21-Aug-13 1:18am
   
Excellent. To the point. ↑voted.Added some more with below answer.
Mehdi Gholam at 21-Aug-13 1:21am
   
Thanks Rohan!
R_sharma at 21-Aug-13 1:23am
   
what does dataset is "not multiuser" implies?
Mehdi Gholam at 21-Aug-13 1:29am
   
Changes in your dataset will not show in other computers.
R_sharma at 21-Aug-13 1:34am
   
u mean to say that the changes in datatable reflects in other computer??
Mehdi Gholam at 21-Aug-13 1:41am
   
Yes.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Comments
Mehdi Gholam at 21-Aug-13 1:21am
   
5'ed
Rohan Leuva at 21-Aug-13 1:23am
   
Thanks Mehdi.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

DataSets can hold several DataTables and also the relationships between them -- if you need that, you need a DataSet; if you don't need that, you don't need a DataSet.
 
"represents an inmemory database" -- I never need that.
 
I very rarely use a DataSet, they are too heavy for what I do. I use DataTables sometimes, but DataReaders quite a bit.
 
And you can bind a DataTable to a DataGridView and other controls as well.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 613
1 BillWoodruff 299
2 PIEBALDconsult 290
3 George Jonsson 265
4 Sergey Alexandrovich Kryukov 254
0 Sergey Alexandrovich Kryukov 10,694
1 OriginalGriff 5,354
2 Maciej Los 5,354
3 CPallini 3,729
4 BillWoodruff 3,556


Advertise | Privacy | Mobile
Web03 | 2.8.141029.1 | Last Updated 21 Aug 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100