It depends on your operation. You have to decide based on your situation and for what you are going to utilize that data. As per my experience in many situations I have used both dataset and data reader. Normally what I will do is, before writing code I will think what am I going to do with this data, Whether I am going to manipulate it or just read and show the data. If I am going to manipulate (Edit/update etc) then I will choose dataset otherwise I will go for DataReader.
EX : let's Say.. I have a requirement like this.. in a webpage I have a dropdownlist and based on dropdownlist selection I need to display data inside Gridview with lot of CRUD operation. Now usually we don't edit data which is available inside dropdown, so in that case use DataReader. It loads data faster than the dataset, because you know it is doing only read only operation. Hence performance is also good.
Also I will give you few more tips for you to use DataReader and Dataset , that will help you if you keep it in mind. Those are:
1. DataSets can easily be passed between layers in an application.
2. When you have data that is accessed by a number of users and can reasonably be cached for at least a short period of time, the cache can be used on a DataSet. Caching can have a dramatic impact on the performance of a heavily used application.
3. One of the disadvantage of using a DataReader is that the connection must be open while you are accessing the data.
4. One of the big advantage of using dataset is, It is a database-independent, in-memory data store that enables the developer to directly access all rows and columns of one or many tables that a DataSet can contain.
5. Suppose if you are building a Windows Forms application (or a "Smart Client"), DataSets offer some advantages. Since the application will maintain its state over the entire time it is running, and client context does not tie up server resources, using a DataSet can be very convenient for Windows Forms applications.
Finally as a one word I WOULD SUGGEST..
SMALLER PROJECTS REQUIRES BETTER PERFORMANCE USE DATAREADER, LARGE SCALE/BIGGER APPLICATIONS REQUIRES BETTER PERFORMANCE USE DATASET.
Patel28rajendra, if this helps please login to Mark As Answer. | Alert Moderator