This is a normal program, this program is placed in a page, no matter how you brush or how many people at the same time request the page, pending the processing of the end, through the sp_who check to see, or that one. You know why this is called a normal procedure, it fits the normal reasoning.
using (SqlDataReader reader = Maticsoft.dbutility.dbhelpersql.executereader ("SELECT top 1 * out protuct ORDER BY id DESC" ))
{
while (Reader.read ())
{
Response.Write (reader["name"].tostring ());
}
}
using (SqlDataReader reader2 = Maticsoft.dbutility.dbhelpersql.executereader ("SELECT top 1 * from users ' ORDER by UserID de SC "))
{
while (Reader2.read ())
{
Response.Write (reader2["username"].tostring ());
}
}
Take a look at the connection data code that some of our friends will use frequently.
Data source=.; Catalog=test;persist Security info=true;user id=testuser;password=123456;min pool Size=10;max pool size=150 initial; Connection lifetime=10
Min Pool Size=10;max Pool size=150;connection lifetime=10
Database tutorial Connection pool, the default is enabled, the above properties is to configure this connection pool. This also means that when your page sends a database request, it is not necessarily necessary to create a database connection, but it is possible to activate a connection from an existing connection pool to process your request; Similarly, when you call close explicitly closes the database connection in your code, it is not necessarily true to close the database connection. , if the current connection pool does not have a connection that meets the min pool size requirement, it simply returns to the connection pool and waits for the next command to activate it
sp_who ' testusers '//testusers is the user name you specified when you established the connection
Look at the number of connections, now you see.