Difference between Dataset and DataReader in ado.net in asp.net

This asp.net tutorial explains, the difference between a dataset and datareader in ado.net in asp.net.

The dataset in ado.net represents an in-memory cache of data. The DataSet consists of a collection of DataTable objects that you can relate to each other with DataRelation objects.

Difference between Dataset and Datareader asp.net

Below are few differences between dataset and datareader in ado.net in asp.net.

Dataset in asp.net

  • Dataset is defined with multiple tables.
  • It is a disconnected architecture.
  • It can’t be defined without DataAdapter.
  • Dataset is able to fetch a record in bi-direction.
  • Dataset having read/write access.
  • It comes under disconnected architecture.
  • Dataset is slower as compared to DataReader.

Datareader in asp.net

  • DataReader is a read-only and forwards only data i.e Read-Only access.
  • You can access one table at a time.
  • It comes under connected architecture.
  • One of the most advantages is that it is much faster than the dataadapter.
  • Using DataReader only one value can be accessed at a time from the database.
  • Here the data is retrieved based on the select statement.
  • We can’t do DML operations through DataReader.

You may like following asp.net tutorials:

Hope this asp.net tutorial explains the difference between dataset and datareader in ado.net in asp.net.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

>