Click here to Skip to main content
15,609,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Binding Gridview with datareader or dataset, Which one is better?

Binding a large amount of data to a datagrid will take more time , to avoid the time delay of binding large amount of data we can use DataReader instead of DataSet or DataTable.By Default , Datareader is fast compared to DataSet or DataTable.
Share this answer
Use DataSet as u can directly bind that to the gridview and can convert it into table,or default view One Important thing is that it is disconnected source of architecture as compared to datareader.
Share this answer
It Depends of your need. One is a connected architecture and another one is disconnected architecture. The simplest rule is if you want to use (Select, insert, update, delete) the same data again and again in within the page lifecycle then go for dataset else data reader. There are lot of other points depends on situation that will come a separate article. Browse MSDN and also you will get chance of other experts answers.
Share this answer
Since a dataset is disconnected architecture, it has the advantage of being able to be cached, whereas the datareader has to connect to the database every time it is used. Caching speeds up the user experience on the client side while reducing the number of active connections on the database server.
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