Difference between Data Reader and Data Set in Asp.Net | Data Reader vs. Data Set
Difference between Data Reader and Data Set in Asp.Net
||Data Reader is directly connected to database system i.e works in connected mode.
||Data Set is generally used to employ disconnected architecture of ADO.Net. It works in disconnected mode.
|No. of Tables
||Data Reader can hold one table at a time.
||Data Set can hold multiple tables at a time. It represents a computer set of data including related tables, constraints and relationships among the tables.
||Data reader can use multiple user updated data every time.
||If multiple users are using the database and database needs to be updated every time, you must not use the data set.
||Data Reader provides Read only access to data i.e. we can not update data.
||Data Set allows access on data i.e with that you have read and update access.
||Data Reader is like a forward only scan of records.
||Data Set allows both forward & backward scan of records
||No Local storage is required
||It reads data from database and stores in local system.
||Data Reader improve application performance.
||Data Set is always a bulky object that requires lot of memory space compare to Data Reader.
||It holds one row at a time.
||It holds multiple rows at a time.
||It occupies less memory.
||It occupies more memory
||It does not maintain relationship.
||It maintains the relationship.
||No XML storage available.If data does not need to be modified, cached or serialized consider using a reader.
||Can be stored as XML.