re: DataReaders--Using the right tool for the job

| No Comments | No TrackBacks
I have to say, that for many cases, in the ASP.NET world, a DataReader really is the right tool for the job, though I will admit if not used (and more importantly, closed) correctly, it can be a problem.

I do not index DataReaders by field number, any more than I would index a DataSet by field numbers, and so generally, adding or rearranging the column list in a select or Stored Procedure will have no impact on my code.

I have been very rigorous to ensure that all code closes the DataReader, and in many sites, and many pages and many millions of hits, I have not seen a problem tied to not closing a datareader. I have certainly seen other code that does, but it has not been my experience. All of my methods returning DataReaders uses the CloseConnection, and I always do the close in a finally block...

No TrackBacks

TrackBack URL: http://betav.com/blogadmin/mt-tb.cgi/1717

Leave a comment

Pages

Powered by Movable Type 4.21-en

About this Entry

This page contains a single entry by William Vaughn published on February 25, 2005 6:20 PM.

DataReader better than DataAdapter? Mayyybee :-) was the previous entry in this blog.

DataAdapter.Fill Preferable to DataReader? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.