Since there is no memory buffer is maintained by the data reader, it takes up fewer resources and performs more efficiently with small number of data operations.
The dataset, on the other hand is more efficient when large number of updates are to be made to the database. All the updates are done in the local memory and are updated to the database in a batch. Since database connection remains open for the short time, the database management system does not get flooded with the incoming requests.
However, since the dataset stores the records in the local buffer in the hierarchical form, it does take up more resources and may affect the overall performance of the application.
Asked In: Many Interviews |