如何计算由asp.net中的页面执行的所有查询 [英] How to count all the queries executed by a page in asp.net

查看:60
本文介绍了如何计算由asp.net中的页面执行的所有查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想列出页面执行的所有查询,并记录页面执行的所有查询.我正在使用MYSQL.

I want to list out all the queries executed by a page and log the all queries executed by a page. I am using MYSQL. Can any one help me with this?

推荐答案

您的问题的答案是Log4Net,您将在这里找到:
The answer to your problem is Log4Net which you will find here: http://logging.apache.org/log4net/[^].
It''s a logging framework derived from a Java project Log4J and has all the stuff you need to do good logging. It can be customized if you want to, but for starters you''ll probably be quite happy with it the way it is.

Cheers,

-MRB


我认为对您来说,编写自己的逻辑更好.
因为它可能包含select,update,sp等.
因此,请全局维护一个变量,并按页面或会话查询编写自己的逻辑
I think for you it is better to write your own logic.
because it may contain select,update,sp,etc..
So Maintain one variable globally and write your own logic


查询.在设计时可以知道按页面查询.我认为您正在按会话查询特定页面的查询.即使不是页面全局变量也不会破坏页面html呈现后破坏的页面全局变量,您也需要会话变量计数器Session[Page1_Queries]并在每次查询成功时递增.
Queries by a page or queries by a session. Queries by page can be known at design time. I think you are asking about queries by session for the particular page. Even not page global variable which destroyed once the page html rendered, you need a session variable counter Session[Page1_Queries] and increment whenever you succeed with a query.


这篇关于如何计算由asp.net中的页面执行的所有查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆