SqlConnection.ClearPool(SqlConnection) SqlConnection.ClearPool(SqlConnection) SqlConnection.ClearPool(SqlConnection) SqlConnection.ClearPool(SqlConnection) Method

定义

清空与指定连接关联的连接池。Empties the connection pool associated with the specified connection.

public:
 static void ClearPool(System::Data::SqlClient::SqlConnection ^ connection);
public static void ClearPool (System.Data.SqlClient.SqlConnection connection);
static member ClearPool : System.Data.SqlClient.SqlConnection -> unit
Public Shared Sub ClearPool (connection As SqlConnection)

参数

connection
SqlConnection SqlConnection SqlConnection SqlConnection

要从池中清除的 SqlConnectionThe SqlConnection to be cleared from the pool.

注解

ClearPool 清除与关联的连接池connectionClearPool clears the connection pool that is associated with the connection. 如果与其他连接相关联connection是用在调用时,它们被适当标记并且时丢弃 (而不是返回到池)Close对其调用。If additional connections associated with connection are in use at the time of the call, they are marked appropriately and are discarded (instead of being returned to the pool) when Close is called on them.

适用于

另请参阅