A transmission error occurs when sending a request to the server. (Provider: Shared Memory provider

Source: Internet
Author: User
Author: Qing Jun original address: blog. csdn. netqingdujunarticledetails36426825sqlserver2008 + VS2010 code written in C #. When restoring the database, an error occurs: error message: a transmission-level error occurs when sending a request to the server. (Provider: Shared Memory provider, error: 0

Author: Qing Jun original address: http://blog.csdn.net/qingdujun/article/details/36425825 SQL Server 2008 + VS2010 with C # written code, database restoration, error: Error content: A transmission error occurs when sending a request to the server. (Provider: Shared Memory provider, error: 0-Manager

Author: Qing Dujun

Address: http://blog.csdn.net/qingdujun/article/details/36425825

When SQL Server 2008 + VS2010 uses code written in C # To restore the database, an error occurs:

Error message:

A transmission error occurs when sending a request to the server. (Provider: Shared Memory provider, error: 0-there is no process on the other end of the MPs queue.

Solution:

Construct the SQL link statement as follows:

string strLink = @"server=.;database=DataBaseName;uid=sa;pwd=123456;pooling=false";
The above is the same, but a pooling = false is added to the backend. The connection pool is not used.

----------------------------------------

Analysis description:

In fact, we have been using the SqlServer connection pool. In the connection string, Pooling indicates whether to enable the connection pool. The default value is true, indicating that the connection pool is enabled.

Two important parameters related to the connection Pool are Min Pool Size and Max Pool Size, which are the minimum number of connections in the Pool and the maximum number of connections in the Pool. The default values are 0 and 100, respectively.

When we create a connection instance and call the Open () method, the connection pool administrator finds an available connection in the connection pool. when the Close () method is called, the connection pool manager returns the connection to the connection pool for the next call of the Open () method.

In addition, the Connection Lifetime in the Connection string sets the lifecycle for the Connection in the Connection pool. The default value is 0. When the Connection is returned to the pool, the creation time is compared with the current time. If the length of time (in seconds) exceeds the value specified by Connection Lifetime, the connection will be destroyed. This is useful in clustering configuration (used to force load balancing between running servers and servers that are just online ). If the value is zero, the connection pool has the maximum connection timeout.

From the above understanding, we can see that even the simplest connection string is using the connection pool.

Reference: Baidu knows that a transmission-level error occurs when a request is sent to the server. (Provider: Shared Memory provider, error: 0-No [CP/OL]. http://zhidao.baidu.com/question/1573456795577498260.html,2013-09-27/2014-07-02 on the other end of the MPs queue.

Qi Fei's Blog. SQL Server connection pool and its usage [CP/OL]. http://www.cnblogs.com/youring2/archive/2011/06/18/2084442.html,2011-06-18/2014-07-02.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.