Datasets in ASP.NET

posted on 2005-05-05 at 19:34:30 by Joel Ross

Scott Mitchell has another great article on the 4Guys site about why he doesn't use Datasets in ASP.NET applications, and then lays out why he doesn't. It's a good read, and reflects most of the reasons we decided to use custom objects and data readers instead of Datasets on my last project.

Having talked with another project using datasets, I'm glad we made the decision we made. Working with datasets on a web project seems to me to be more hassle than it's worth.

Oh yeah. You should also read through this blog post, where there's quite a few comments on both sides of the isle.

UPDATE: I wrote this, and hadn't had a chance to publish it, but Eric Wise has a post saying he uses them for simple display of data, because he doesn't want to have a database connection in his UI code. I think one of the things he said is false though - that creating a collection of those values with custom objects is slower than binding to a data table. From what I saw, Scott's article refutes that claim. Either way, we got around having to make the decision by caching look up tables that are used in drop downs, using the same custom object for all of the different look up tables, and using database cache invalidation.

UPDATE, PART 2: Man, I need to start publishing these things faster! Eric has updated his post to include some data.

Categories: ASP.NET