Click here to Skip to main content
13,350,486 members (62,637 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 20:08pm
Rate this: bad
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
Rohan Leuva 21-Aug-13 1:18am
Excellent. To the point. ↑voted.Added some more with below answer.
Mehdi Gholam 21-Aug-13 1:21am
Thanks Rohan!
R_sharma 21-Aug-13 1:23am
what does dataset is "not multiuser" implies?
Mehdi Gholam 21-Aug-13 1:29am
Changes in your dataset will not show in other computers.
R_sharma 21-Aug-13 1:34am
u mean to say that the changes in datatable reflects in other computer??
Mehdi Gholam 21-Aug-13 1:41am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Mehdi Gholam 21-Aug-13 1:21am
Rohan Leuva 21-Aug-13 1:23am
Thanks Mehdi.
Rate this: bad
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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180111.1 | Last Updated 21 Aug 2013
Copyright © CodeProject, 1999-2018
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