Provider: Named Pipes provider, error: 40-cocould not open a connection to SQL Server Solution

Source: Internet
Author: User
Provider: Named Pipes provider, error: 40-cocould not open a connection to SQL Server

Server Error in '/'application.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. the server was not found or was not accessible. verify that the Instance name is correct and that SQL server is configured to allow remote connections. (provider: Named Pipes provider, error: 40-cocould not open a connection to SQL Server)

Description:An unhandled exception occurred during the execution of the current Web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception details:System. data. sqlclient. sqlexception: a network-related or instance-specific error occurred while establishing a connection to SQL Server. the server was not found or was not accessible. verify that the Instance name is correct and that SQL server is configured to allow remote connections. (provider: Named Pipes provider, error: 40-cocould not open a connection to SQL Server)

 

 

When the website is configured, an error is prompted when the website is opened,Provider: Provided by the named PipelineProgram, Error: provider named pipeline provider, error: 40 cannot open the link to SQL Server.

An error occurred while establishing a connection with the server. When you connect to SQL Server 2005, the default setting does not allow remote connection to SQL Server may cause this failure. (Provider: named pipeline provider, error: 40-unable to open the connection to SQL Server)
After I installed SQL Server2000, I installed SQL server2005. There are many solutions on the Internet!
The following is a list:
1. In the Start menu, there is an SQL server2005 peripheral program configurator under SQL server2005 in the program. Select the peripheral configurator of the service and connection, and select remote control in the database engine, change the local connection and remote connection to use TCP/IP and named pipes at the same time! Save. Close the connection to the database server and click "reconnect!

2. The data source in the database connection string in the configuration file web. config uses the name of the local server. Do not use an IP address, loacl, or.
Example: <add key = "statdb. connectstring" value = "Data Source = MICROSOF-9D13DF; initial catalog = users; user id = sa; Password = sa"/>
3. Delete the default database link string in the IIS configuration, because after SQL server2005 is installed, the default connection is 2005.
My computer, management, default website in IIS configuration, right-click to view properties, select your version for Asp.net version, then, delete the default string link in edit configuration and edit global configuration!
 

Modify and edit global configurations

If the red circle contains the default database connection string, remove it!
4. Install SQL Server patches.
This prompt is displayed when you view the database logs!
You have known security vulnerabilities when using Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also known as MSDE) and Microsoft Windows Server 2003. To reduce computer attacks by some viruses, Microsoft SQL Server 2000, MSDE or both of the TCP/IP and UDP network ports are disabled. To enable these ports, you must install a patch from your http://www.microsoft.com/ SQL /downloads/default.asp or http://www.microsoft.com/china/ SQL /downloads/default.asp, or the latest service package for Microsoft SQL Server 2000 or MSDE.
Download the patch and add it!
5. Modify the remote connection port of SQL Server
When SQL Server2000 is installed and SQL server2005 is installed, the latter changes the remote connection port of SQL Server2000 to 1433. When I checked it, it was changed to port 1058.
Change it to 1433!
Start Menu. There is a server network tool under SQL Server2000 in the program. Select TCP/IP and click Properties to edit its port

Select TCP/IP to modify its attributes

5. jpg (16.67 K) 9:39:16

set the default port to 1433
In conclusion, because I encountered such a problem and found a solution for a long time, I used the port modification method to solve the problem of database connections. I hope the methods I have summarized will be useful to you!

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.