/// <summary> /// 获取连接池 /// </summary> static void getConnection() { SqlConnection conn = null; try { conn = ConnectionPoolProxy <SqlConnection> .getConnecion(); string strSql = " select top 10 * from [dbo].[User] with(nolock) "; string errorMessage = string.Empty; if (conn != null) { conn.ConnectionString = connectionString; } DataSet ds = SqlHelper.executeDataSet(strSql, conn, out errorMessage); } finally { ConnectionPoolProxy <SqlConnection> .closeConnecion(conn); } }
/// <summary> /// 数据库连接池重置 /// </summary> static void resetConnection() { ConnectionPoolProxy <SqlConnection> .resetConnecion(); }