asp.net中获取数据连接的统计信息
来源:互联网 发布:如何缓解焦虑情绪 知乎 编辑:程序博客网 时间:2024/06/05 12:49
protected void Page_Load(object sender, EventArgs e)
{
string connString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;
SqlConnection conn = new SqlConnection(connString);
conn.StatisticsEnabled = true;//如果设置为true,则对当前连接启用统计信息收集
conn.ResetStatistics();//如果启用统计信息收集,则所有的值都将重置0
conn.Open();
SqlCommand cmd = new SqlCommand("SELECT * FROM Orders", conn);
SqlDataReader reader = cmd.ExecuteReader();
reader.Close();
conn.Close();
Hashtable ht = (Hashtable)conn.RetrieveStatistics();
foreach (string key in ht.Keys)
{
Label1.Text += "Key: " + key + " = " + ht[key] + "<BR />";
}
}
运行结果:
Key: NetworkServerTime = 0
Key: BytesReceived = 156913
Key: UnpreparedExecs = 1
Key: SumResultSets = 1
Key: SelectCount = 1
Key: PreparedExecs = 0
Key: ConnectionTime = 0
Key: ExecutionTime = 0
Key: Prepares = 0
Key: BuffersSent = 1
Key: SelectRows = 830
Key: ServerRoundtrips = 1
Key: CursorOpens = 0
Key: Transactions = 0
Key: BytesSent = 48
Key: BuffersReceived = 20
Key: IduRows = 0
Key: IduCount = 0
- asp.net中获取数据连接的统计信息
- Asp.net管理信息系统中数据统计功能的实现
- ASP.NET连接数据库并获取数据
- ASP.NET连接数据库并获取数据
- ASP.NET连接数据库并获取数据
- ASP.NET连接数据库并获取数据
- ASP.NET 中获取客户端浏览器信息
- asp.net中SqlDataReader获取数据存在的问题解决方法
- asp.net连接数据持续更新中。
- .net中的数据连接信息的位置
- Scott Mitchell 的ASP.NET 2.0数据教程之十五:在GridView的页脚中显示统计信息
- Scott Mitchell 的ASP.NET 2.0数据教程之十五:在GridView的页脚中显示统计信息
- Scott Mitchell 的ASP.NET 2.0数据教程之十五:在GridView的页脚中显示统计信息
- Scott Mitchell 的ASP.NET 2.0数据教程之十五:在GridView的页脚中显示统计信息
- asp.net 获取服务器信息
- asp.net获取客户端信息
- asp.net 获取服务器信息
- asp.net 获取服务器信息
- SQL--JOIN之完全用法
- Asp.net(c#)实现多线程断点续传
- Scott Mitchell 的ASP.NET 2.0数据教程之二十六::排序自定义分页数据
- Use xfire to done your web services in java
- 微软,您的.net为中国程序员带来了什么?
- asp.net中获取数据连接的统计信息
- [吓着我可不管!]fw:标题:堪称世界上最丑的狗死了 连夺三冠吓退评委
- flash类单态模式的写法与疑问
- Java EE 5.0能取代Struts,Spring和Hibernate吗?
- 关于光盘统计发放方法思索
- Tapestry framework component -------propertyselection
- ASP.Net中如何使用ClientID
- java web start关于初始堆大小的一个有意思的bug
- 删除数据 数据库大小的压缩