Register now or log in to join your professional community.
It depends on your needs. If you want to do readonly fast reading then use DataReader. And if you want to load data from multiple Tables. and you want to store it in single place. And you want to work with data after disconnectivity then Dataset is good.
DataSet is actually the collection of DataTables, DataRelations and you can load Data from Xml source also.
that depends on the data you want from the database...you can go for data reader if you want a single record.....and if you want multiple records than you can go for dataset.. bcoz we can directly bind that to a data source..but when you use data reader for multiple records we cannot directly bind those records to an datasource. and for -loop is used to bind those records which is time consuming and repetetive
DataReader If you want to edit and add into retrieving data
If it's about retrieving the rows then use DataReader faster than DataAdapter.
DataReader is a connected model whereas Dataset is a disconnected ,
you can use DataReader to write to your DataSet through DataRow and DataTable
The difference being DataAdapter behind the scenes creates all the schema and directly adds rows to it .
For DataReader , You will have to manually create the DataTable , then define the DataColumn, then create NewRow() and assign row by row through DataReader.
Dataset