ADO.NET数据库连接池

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

String connString;

// Specification in the connection string:
// Please note: Pooling is implicit, you automatically get it unless you disable it. 
// Therefore, "true" is the default for the pooling keyword (pooling=true).   
// Connection Reset:    False
// Connection Lifetime: 5
// Enlist:              true
// Min Pool Size:       1
// Max Pool Size:       50

connString 
= "server=(local)\NetSDK;Integrated Security=SSPI;database=northwind;" +
             
"connection reset=false;" +
             
"connection lifetime=5;" +
             
"min pool size=1;" +
             
"max pool size=50";
posted @ 2004-07-10 10:44  mp3 swf  阅读(1122)  评论(0编辑  收藏  举报