Click here to Skip to main content
Rate this: bad
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 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 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
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Mehdi Gholam at 21-Aug-13 1:21am
Rohan Leuva at 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
0 Sascha Lefévre 485
1 Sergey Alexandrovich Kryukov 325
2 Maciej Los 230
3 Abhinav S 175
4 Peter Leow 110
0 Sergey Alexandrovich Kryukov 6,953
1 OriginalGriff 6,311
2 Maciej Los 2,732
3 Peter Leow 2,694
4 Abhinav S 2,652

Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 21 Aug 2013
Copyright © CodeProject, 1999-2015
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