Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data reader and time how long open

Status
Not open for further replies.

Badgers

Programmer
Nov 20, 2001
187
US
Hi,

I'm writing a database wrapper to time how long it takes to return and iterate through a datareader.

I don't want to duplicate code, so within my data access class I'd ideally like to detect when the reader is being closed, and when it is stop the timer and log.

But a datareader will keep an open connection to the calling code, and when it is closed in that tier the connection will close. I don't want to put the stop time there, as that would be just verbose.

I've thought of inheriting IDataReader and having my own custom IDisposable / Close event, but was trying to think of something a bit simpler...

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top