예제 #1
0
        /// <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);
            }
        }
예제 #2
0
 /// <summary>
 /// 数据库连接池重置
 /// </summary>
 static void resetConnection()
 {
     ConnectionPoolProxy <SqlConnection> .resetConnecion();
 }