Pradeep
What is the difference between data reader & data set?
By Pradeep in ADO.NET on Aug 27 2009
  • kalit sikka
    Aug, 2009 27

    Data reader 
    1. It is a read only and forward only data.
    2. U can access one table at time.
    3. It can't persist the data.
    4. It is comes under connected architecture.
    5. One of the most advantage is it is much faster than data
    adapter
     
    Data set:
     
    1. It is defined with multiple tables.
    2. It can persist the data.
    3. It is a relational data cache hosted in application
    domain during execution.
    4. It is a disconnected architecture.
    5. It can't defined with out data adapter.
    http://kalitinterviewquestions.blogspot.com/

    • 0
  • Puran Mehra
    Aug, 2009 27

    DataReader

     

    The DataReader is built as a way to retrieve and examine the rows returned in response to your query as quickly as possible.

     

    No DataSet is created; in fact, no more than one row of information from the data source is in-memory at a time. This makes the DataReader quiet efficient at returning large amounts of data.

     

    The data returned by a DataReader is always read only.  This class was built to be a lightweight forward only, read only, way to run through data quickly (this was called a firehose cursor in ADO).

     

    However, if you need to manipulate schema or use some advance display features such as automatic paging, you must use a DataAdapter and DataSet.

     

    DataReader object works in connected model.

     

    DataSet

     

    The DataSet Object is the parent object to most of the other objects in the System.Data namespace. The dataset is a disconnected, in-memory representation of data.

     

    Its primary role is to store a collection of DataTables and the relations and constraints between those DataTables.

     

    DataSet also contains several methods for reading and writing XML, as well as merging other DataSets, DataTables and DataRows.

     

    Some of the advantages of the new DataSet object are:

     

    §         Read / Write

    §         Connectionless

    §         Contains one or more DataTable objects with relationships defined in a collection of DataRelation objects

    §         Supports filtering and sorting

    §         The contained DataView object can be bound to data-aware forms controls

    §         Supports automatic XML serialization (creation of XML document)

     

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS