SQL2005 provider: Named pipe provider error:40 cannot open a connection to SQL Server _mssql2005

Source: Internet
Author: User
Tags microsoft sql server microsoft sql server 2005 mssqlserver

asp.net connection to SQL 2005 database error prompted: An error occurred while establishing a connection to the server. When you connect to SQL Server 2005, this failure may be caused by SQL Server not allowing remote connections under the default settings. (provider: Named pipe provider, error:40-cannot open a connection to SQL Server)

Workaround:

1, to ensure that the user name and password to use the connection can correctly log on to SQL2005.

2, to ensure that the server-side database allows remote connection, login SQL2005 Enterprise Manager, right click on the local Database "Properties",




In the Server Properties dialog box that pops up, select Connect and check "Allow remote connections to this server (A)".




3. TCP/IP to open the SQL Server is allowed, and the 2005--Configuration tool--sql Server Configuration Manager is found in the Start menu, where SQL Server 2005 Network configuration under the MSSQLSERVER protocol below the TCP/IP and named Pipes are enabled.



Also note that the TCP/IP configuration allows you to configure the IPs and port numbers, and dynamic ports are not.



4. Configuring the SQL Server Perimeter Application configurator is allowed for remote connections, locate the Microsoft SQL Server 2005--Configuration Tool--sql the server perimeter Application configurator and open in the Start menu.




In the pop-up window, tap the "service and connectivity Perimeter configurator".


In the perimeter application configurator for Services and Connections dialog box, click: Mssqlserver--database engine--Remote connection, select local and remote connections on the right, and use TCP/IP and named Piese below.





At this point, if you do not modify the default port of MSSQL, you should solve the problem.

Related Article

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.