DataAdapter.Fill Preferable to DataReader?

I love these kinds of posts.

Bill Vaughn describes the very real-world scenario that although the DataAdapter.Fill method is not as performant as the DataReader, there are often maintainence issues associated with passing DataReader's between layers - specifically connections not being closed correctly.  Rocky tosses in his two cents suggesting the same idea.  I can't agree more.

Although I have passed a DataReader between layers in several applications, this is a very fragile solution to save a couple of clock cycles.  In fact, given the fact that output caching is so often used on web pages because most data does not need to be displayed in real-time, any slower performance in DataAdapter.Fill is negligible on scalability due to the use of caching.

posted on Friday, February 25, 2005 10:28 PM

Main

News

Green Tea

.NET Development

Enterprise Library

Patterns & Practices