none
Shutdown a connection pool RRS feed

  • Question

  • Hi,

    ADO.NET connection pool is controlled by parameters in connection string.
    However, once the pool is created and no longer needed after being used,
    How can I shut the pool down? (or close all the opened connections?)

    Thanks,
    Raymond

    Monday, July 16, 2007 10:54 AM

Answers

  • Hi,

     

    There is a static method on the Connection object for releasing the objects in a connection pool.

     

    Data.OleDb.OleDbConnection.ReleaseObjectPool()

     

    Data.SqlClient.SqlConnection.ClearAllPools()

    Data.SqlClient.SqlConnection.ClearPool(mySqlConnection)

     

    Which one you use depends on how your using your database. Hope that helps.

    Monday, July 16, 2007 12:30 PM