The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Driving Vs. Walking

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Michael Mello

Posts: 100
Nickname: knarf
Registered: May, 2004

Michael Mello is .NET Web Developer
Driving Vs. Walking Posted: May 25, 2004 6:12 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Michael Mello.
Original Post: Driving Vs. Walking
Feed Title: melloblog
Feed URL: http://www.thauvin.net/errorpage.htm?aspxerrorpath=/Default.aspx
Feed Description: .NET and Everything After.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Michael Mello
Latest Posts From melloblog

Advertisement
DataReader or DataSet ?

This is often a topic of debate, when working with ADO.NET.  We have to understand that one is not necessarily better than the other, and that each serves its purpose.  The main concern should not be "which is better", but "which is better in the [current] situation".

The DataReader is a read-only, forward-only stream of data from the database.  The data is retrieved as soon as it's available, which allows for better performance.  The DataSet on the other hand, is an in-memory cache of the data, which will not allow us to inspect its data until all the results are retrieved.  Here is a good article that demonstrates this difference: DataSet Vs. DataReader

When working with ASP.NET, I will use the DataReader 95% of the time, because of its quick, efficient access.  The other 5% I'll use the DataSet, when I need to further manipulate the data that is returned.  Again, it's easy to assume that because I use the DataReader more than the DataSet that it's better, but that's not the case.  Take driving vs. walking, for example.  You drive a car to the market because it's quick and easy, but would you take that same car to get the newspaper sitting out in your driveway?  You could argue that one is better than the other, but both serve their purpose.

Here is a good article that explains when you should use one class over another:
Use DataReader or DataSet?

Read: Driving Vs. Walking

Topic: TechEd 2004 News : Web Services Enhancements (WSE) 2.0 for Microsoft .NET Previous Topic   Next Topic Topic: TechEd Update - Monday ... Visual Studio Team System, Web Services Enhancements 2.0, Microsoft...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use