When I talk with working developers, the question I hear most often is: Which is the right approach The answer depends on your problem domain The DataReader is a forward-only fire hose for data It is often the perfect solution for reporting on?.. Data in the database. But forcing a design to use it it allowed Writing Your OWN Dataset-Like Container for Data if you need to use the data after you read A Single Row.
The DataSet, on the other hand, is a great way to hold data from the database, but filling it comes with a performance penalty. If you need to manipulate your data and save it back to the database, the DataSet is really the only game In Town. Using The DataSet To Simply Report On Data (Like ON A Web Page, for Instance) Usually Is The Wrong Approach. I say "usually" Because The are always exceptions to this rule.
Let's look at a specific domain problem:. An e-commerce site Assuming we have a large number of salable items, I would use DataReaders to show the user the products they are looking for and a DataSet for the shopping basket When you list products. by caching all the items in your catalog, you usually lose efficiency when the cache is too large. I usually like to let the database handle the caching of recently used items. It does a better job in most cases. But a smaller DataSet to contain the user's information and shopping basket could be cached in the Web session so that we can limit the number of database reads and writes. If the visitor never ends up buying anything, their shopping basket could simply disappear (and never get persisted) when his or Her session dies.
Just Remember this Caveat: if you need it cached, use a dataset; if you need it onCE, Use a DataReader.