Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Why we call data reader as connection oriented and data set disconnected architecture though we are hitting once to the database and took the values then store in either data reader or data set. After that, we are performing the task. So for this we do not need any connection. Please explain very neatly with an example.

how many records(e.g 10,0000 or 1 lakh) we can store in data reader as well as dataset and in which case we go for data reader rather than data set and vice-versa ?

What is the use of DataReader & DataSet ?
Posted

The datareader doesn't store anything, it simply retrieves the next record from the datastore where the Read method is called. The connection and query remains open while each result is read one at a time. With a dataset all the data is read and stored in the dataset and the connection is no longer needed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900