.net connection pooling

Erez picture Erez · Mar 9, 2011 · Viewed 92.6k times · Source

I don't get what is the syntax difference between regular connection and connection pool.

When I'm using the using key such as:

using (SqlConnection connection = new SqlConnection(connectionString))
{
    connection.Open();
    command.ExecuteNonQuery();
}

Is this the way to perform a connection pool?

Answer

Øyvind Bråthen picture Øyvind Bråthen · Mar 9, 2011

You can read about connection pooling here.

Basically as long as the connection string is the same (including case), connections will be taken from the same connection pool.