we specify the pooling characteristics in the connection string when the SqlConnection is constructed, as shown in the following code sample. Please note: Pooling is implicit, you automatically get it unless you disable it. Therefore, "true" is the default for the pooling keyword (pooling=true).

ADO.NET数据库连接池String connString;
ADO.NET数据库连接池
ADO.NET数据库连接池
// Specification in the connection string:
ADO.NET数据库连接池
// Please note: Pooling is implicit, you automatically get it unless you disable it. 
ADO.NET数据库连接池
// Therefore, "true" is the default for the pooling keyword (pooling=true).   
ADO.NET数据库连接池
// Connection Reset:    False
ADO.NET数据库连接池
// Connection Lifetime: 5
ADO.NET数据库连接池
// Enlist:              true
ADO.NET数据库连接池
// Min Pool Size:       1
ADO.NET数据库连接池
// Max Pool Size:       50
ADO.NET数据库连接池

ADO.NET数据库连接池connString 
= "server=(local)\NetSDK;Integrated Security=SSPI;database=northwind;" +
ADO.NET数据库连接池             
"connection reset=false;" +
ADO.NET数据库连接池             
"connection lifetime=5;" +
ADO.NET数据库连接池             
"min pool size=1;" +
ADO.NET数据库连接池             
"max pool size=50";
ADO.NET数据库连接池

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-09-16
  • 2021-09-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
  • 2022-02-27
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案