Could any one be kind and explain the difference between DataSet and DataTable and which one would the preferred to use and its permance?
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Puneet KankarPosted Aug 22, 2017, 2:39 PM
vishal bhargavaPosted Jul 12, 2020, 3:51 AM
1). DataTable A DataTable is an table which is collection of columns and rows representing with in memory.
Dataset DataSet is a collection of DataTables representing in memory. Whenever you want to fetch data from database, it connects indirectly to the database and create a virtual database in local system and then disconnected from database.
2). Dataset is a collection of tables, which is used in disconnected architecture. Generally to fill DataSet we use fill method of SqlDataAdapter. It can be used for manipulating the data remotely and finally updating the database with the modified data. This way it enables disconnected means of working with data. This improves performance in terms of reducing the number of times a database is accessed for data manipulations.
Amit GuptaPosted Aug 22, 2017, 12:06 PM
Rajkiran SwainPosted Aug 22, 2017, 10:27 AM
DataSet
DataSet is a disconnected orient architecture that means there is no need of active connections during work with datasets and it is a collection of DataTables and relations between tables. It is used to hold multiple tables with data. You can select data form tables, create views based on table and ask child rows over relations. Also DataSet provides you with rich features like saving data as XML and loading XML data.
DataTable represents a single table in the database. It has rows and columns. There is no much difference between dataset and datatable, dataset is simply the collection of datatables.