Once in a while I stumble across a post that tries to decide between DataReader and DataSet. The last one I saw was this, and it even came with the regular performance comparison graph.

I think it's time for someone to stand up and shout: "Stop these comparisons and start comparing apples to apples!". There is really no point comparing these two objects, since they are used for completely different purposes.

The DataReader is great for reading data from the database. It's doing it fast and efficiently. Problem is, it comes with an open connection, which means - you can't carry it with you to the UI layer of your app. You know what - you better won't take it to your BL layer as well.

The DataSet is great for carrying data around. It is disconnected, serializable, generic, can be queried, and has no connection to the database whatsoever.

Do you know how data is inserted into the DataSet when using DataAdapter? That's right - using DataReader!

So in fact, DataReader and DataSet are not competitors - they are complementary! You grab the data using DataReader and put it in a DataSet!

So what the real question is? When asking about DataReader vs DataSet the real question usually is this:

Can I write a data-carrying object which is more efficient that DataSet? Can I improve its serialization, performance, size or anything else?

Now this is a real question, with many answers. This is the place where ORM tools get into the picture and where Entity Framework start to shine, but that's a really different story.

So please - start comparing apples to apples.