开发者

Query count in .net

I'd like to do something similar to 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!


You can use PostSharp for this.


The latest version of ANTS Performance Profiler allows you to use Event Tracing for Windows to pick up the SQL Queries as well. You may be able to automate this, but I'm not sure.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜