Use the connection pool ---------- If OLEDBConnection, the connection pool is automatically handled by the provider ---------- If it is the SQLConnection class, the connection pool is implicitly managed but can also manage itself. Specify pooling = true in the connection string; connection life = 5; // Declaration cycle min pool size = 1; // minimum connection number Max pool size = 50; // maximum connection number
Let's take a look at: <% @ page language = "c #" contentty = "text / html" responseEncoding = "gb2312" debug = "true"%> <% @ import name "%> system.data"%> <% @ import Namespace = "system.data.sqlclient"%>