Ching
Original address: http://blog.csdn.net/qingdujun/article/details/36425825
SQL Server + VS2010 code written in C #, error in database restore:
Error content:
A transport-level error occurred while sending the request to the server.(Provider: Shared Memory provider, error:0-there is no process on either end of the pipeline.
Workaround:
Construct a SQL link statement such as the following:
String strlink = @ "server=.; Database=databasename;uid=sa;pwd=123456;pooling=false ";
The front is still the same, just add a pooling=false in the back, not use the connection pool.
————————————————————————————————————————
Analysis Description:
In fact, we've been using SQL Server's connection pool. In the connection string, pooling is enabled for connection pooling, and the default value is true. Indicates enabled.
The two important parameters related to connection pooling are min pool size and max pool size, each of which is the minimum number of connections in the pool and the maximum number of connections in the pool, with the default values of 0 and 100 respectively.
When we create an instance of a connection and call the open () method, the connection pooling manager finds an available connection in the connection pool. When the close () method is called, the connection pool manager also returns the connection to the connection pool for use by the next call to the open () method.
Other than that. The Connection Lifetime in the connection string sets the life cycle for the connection in the connection pool. Its default value is 0. When a connection is returned to the pool, its creation time is compared to the current time, assuming that the length of time (in seconds) exceeds the value specified by Connection Lifetime. The connection will be destroyed. This is very useful in a clustered configuration (used to enforce load balancing between servers in execution and servers that have just been put online). A value of 0 (0) causes the connection pool to have the maximum connection timeout.
Through the above understanding. We can see that even the simplest connection string is using a connection pool.
References: Baidu knows. A transport-level error occurred while sending the request to the server. (Provider: Shared Memory provider, error:0-there is nothing [cp/ol] on one end of the pipeline. Http://zhidao.baidu.com/question/1573456795577498260.html. 2013-09-27/2014-07-02.
Qi Fei ' s blog.sql Server connection pool and how it is used [Cp/ol]. Http://www.cnblogs.com/youring2/archive/2011/06/18/2084442.html. 2011-06-18/2014-07-02.
A transport-level error occurred while sending the request to the server. (Provider: Shared Memory provider, error:0-there is no process on either end of the pipeline.