I'd like to do something similar to http://stackoverflow.com/questions/2116960/queries-count-for-page-in-asp-net-mvc - namely count the number of SQL queries executed in a particular request, and time them.
The difference is, I don't have a standard method that all SQL queries are routed through - I need a method for intercepting all calls and tracking them. Is there some kind of hook I could use, or do you know of a tutorial for using the .NET profiler to record calls to and from a method, or even another method?
I don't want to use the SQL Server profiler library for this - I want something built into .NET so there are no dependencies. THanks!