DataReader clarification

Results 1 to 2 of 2

Thread: DataReader clarification

  1. #1
    Join Date
    Dec 1969

    Default DataReader clarification

    Is it true that you shouldn't use the DataReader when you're accessing multiple tables? I've used it successfully for simple joins, but just read that this wasn't advised. Thanks in advance for your guidance on this.

  2. #2
    Join Date
    Dec 1969

    Default RE: DataReader clarification

    The DataReader object is touted as being a very fast and efficient one way facility for data. This is in fact very true. Once a SQL statement is supplied and the DB server has returned a lump of records, the DataReader will give you amazing performance when reading that data out. <BR><BR>The DataSet in contrast is a very robust facility for manipulating data and multiple sets of related or non related data. This is available AFTER the data has been read into the DataSet. Meaning two separate querries returning two separate sets of data from the DB server can be linked and altered as a relational set AFTER the fact. A DataReader can not.<BR><BR>This is what is meant by accessing multiple tables. As a DataSet can hold multiple sets of data in multiple tables within itself. <BR><BR>When you asked your DB server to join tables and to perform whatever extravagant feats of organization that most DB servers are capable of, your DataReader was frankly unaware. The DB Server made the appropriate manipulations and gave to your Reader a SINGLE table of information. For all the Reader knew, this data existed in the DB server exactly as it has recieved it. It knows not that the data it holds has gone through a complex procedure on the Database! <BR><BR>Hope that explanation helped.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts