private void Form1_Load(object sender, EventArgs e)
{
SqlConnectionStringBuilder s = new SqlConnectionStringBuilder();
s.MaxPoolSize = 100;
s.MinPoolSize = 10;
s.DataSource = "Localhost";
s.InitialCatalog="DatabaseName";
s.PersistSecurityInfo=true;
s.UserID="sa";
s.Password="Pass@word";
MessageBox.Show(s.ConnectionString);
}
默认MinpoolSize为0,是单个连接,如果使用0以上的数字,则代表你是在使用连接池。