Search code examples
c#.netado.netconnection-pooling

.net connection pooling


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?


Solution

  • 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.