Saturday, September 7, 2013

Difference between DataReader, DataTable and DataSet

DataReader
1. Its an connection oriented, whenever you want fetch the data from database that you need the connection. after fetch the data connection is diconnected. 
2. Its an Read only format, you cann't update records. 

DataSet
1. Its connectionless. whenever you want fetch data from database. its connects indirectly to the database and create a virtual database in local system. then disconnected from database.
2. Its easily read and write data from virtual database.

DataTable
A DataTable object represents a single table in the database. It has a name rows and columns.
There is not much difference between dataset and datatable, dataset is just the collection of datatables.