Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 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

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
 
Share this answer
 
Comments
Thanks7872 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!
Rambo_Raja 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.
Rambo_Raja 21-Aug-13 1:34am    
u mean to say that the changes in datatable reflects in other computer??
 
Share this answer
 
Comments
Mehdi Gholam 21-Aug-13 1:21am    
5'ed
Thanks7872 21-Aug-13 1:23am    
Thanks Mehdi.
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.
 
Share this answer
 

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