.NET连接池连接池、NET

2023-09-03 00:48:24 作者:起哄者

我不明白什么是有规律的连接和连接池之间的语法差异。

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

当我使用使用键,例如:

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

这是执行连接池的方式?

Is this the way to perform a connection pool?

推荐答案

您可以阅读有关连接池这里。

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.