Diff B/W DataSet vs DataTable

Answer Posted / umarali1981

DataTable:

1.Meaning: A DataTable is an in-memory representation of a
single database table which has collection of rows and columns

2.Number of rows retrieved at a time:DataTable fetches only
one TableRow at a time

3.Provision of DataRelation Objects:As DataTable is a single
database table, so there is no DataRelation object in it.

4.Enforcing Data Integrity:In DataTable, there is no
UniqueConstraint and ForeignKeyConstraint objects available.

5.DataSource can be Serialized or Not:In DataTable,
DataSource cannot be serialized.

6.To know the example for DataTable, please try the URL:

http://www.dotnetperls.com/datatable

DataSet:

1.Meaning:A DataSet is an in-memory representation of a
database-like structure which has collection of DataTables.

2.Number of rows retrieved at a time:DataSet can fetch
multiple TableRows at a time

3.Provision of DataRelation Objects: In DataSet, DataTable
objects can be related to each other with DataRelation objects.

4.Enforcing Data Integrity:In DataSet, data integrity is
enforced by using the UniqueConstraint and
ForeignKeyConstraint objects.

5.DataSource can be Serialized or Not:DataSet is serialized
DataSource .That is why web services can always returns
DataSet as the result but not the DataTables.

6.To know the example for DataSet, please try the URL:
http://www.dotnetperls.com/dataset

Reference:
http://onlydifferencefaqs.blogspot.in/2012/08/difference-between-datatable-and-dataset.html

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we save all data from dataset?

535


What is the significance of CommandBehavior.CloseConnection ?

569


What is ado.net tutorial?

501


What are the differences between OLEDB and SQLClient Providers?

564


What is ado asp?

513






What is the use of Dataview?

575


What property must be set and what method must be called in your code to bind the data from some data source to the Repeater control?

552


What is ado net stands for?

515


What is the difference between statement and preparedstatement interface?

563


Explain the advantage of ADO.Net?

551


Which keyword is used to accept variable number of parameters?

682


What are the different ado.net namespaces are available in .net?

495


Explain how to bind the controls(best practice) comboboxes to the data in the dataset?

556


What are the several execute methods of ado.net?

499


What is difference between datareader and dataadapter?

546