This post by Scott Mitchell points his article where he discusses why he doesn't use Datasets in ASP.NET Applications. I guess I've never really thought about it (maybe a bad thing?) but I don't use DataSets in WebApps either. Not on purpose it's that I've not been faced with a situation to need the added functionality that the DataSet provides. I know that the DataReader is the forward-only/read-only data object that is most efficient when reading data so that's what I've used. So far in WebApps, I've not needed to add/update/delete data without committing it immediately to the database so I just use StoredProcs for this or if there is a delay then I'll keep the data in a custom class before calling an update method or something similar. Anywho, it's a very good article and no, he's not saying never use a DataSet he's just saying that there are trade-offs.
* "According to A Speed Freak's Guide to Retrieving Data in ADO.NET, the DataReader is roughly thirty times more performant than the DataSet."
Article outline
- The Fundamentals the DataReader
- The Fundamentals of the DataSet
- The Tradeoff Between the DataSet and DataReader
- When is a DataSet Useful?
- Reasons Why You May Be Using a DataSet... and Reasons Why You Probably Shouldn't
* I noticed Scott's use of "performant". Jeff brought this up in a recent post of his...not Scott's use of the word but the use of non-word's in devspace. I chuckled when I saw it.