DataReader vs. DataSet

In a 4 Guys article entitled Why I Don’t Use DataSets in My ASP.NET Applications and in a blog post, Scott Mitchell discusses the merits of using DataSets to retrieve data in an ASP.net application (or lack thereof). Here’s the gist of it:

Although DataSets provide many useful builtin functions, they add a large amount of overhead (which will increase the more data is retrieved). Check out A Speed Freak’s Guide to Retrieving Data in ADO.NET for more conclusive numbers backing this up. The increase in performance using a DataReader (or SqlDataReader if you are using Sql Server) more than offsets the loss of functionality. So Scott concludes (though many of his other readers disagree).

Personally, I agree. So far I have exclusively used SqlDataReaders in my development efforts. (Though as soon as I start working more with Web Services, XML and Desktop I will probably start to delve in to DataSet-land).

Update: Scott has posted a new article on 4Guys: More On Why I Don’t Use DataSets in My ASP.NET Applications, responding to 60+ comments that were made on the original article. If anything, he is now even more adamant that DataReader is the only way to go.

Tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *