The database system that was just installed, as per the default installation, is likely to be wrong with the remote connection times, usually error: "When you connect to SQL Server 2005, SQL Server does not allow remote connections under the default settings, which can cause this failure. (provider: Named pipe provider, ERROR:40-Unable to open connection to SQL Server) "Search MSDN, there is a machine translation of the article, is difficult to understand, now summarized as follows: Understand that SQL Server is a network database can be solved, simply divided into the following concentration situation.
1. The database engine is not started.
There are two ways to start:
(1) Start-up program->microsoft SQL Server 2005-> SQL Server 2005 Surface Area Configurator, click the connected surface Area configuration of the service in the Open interface, locate the database Engine in the Open interface, click Services, see if it is started on the right side, if it is not started, click Start, and make sure that the startup type For automatic, do not manual, or the next time you start up manually;
(2) Open: Start-up program->microsoft SQL Server 2005-> Configuration tool->sql Server config Manager, select SQL Server 2005 service in SQL Server (MSSQLSERVER), and click the "Start Service" button in the toolbar to change the service status to start;
When using either of these methods, sometimes errors may occur at startup and cannot be started, so you should see if via is enabled in SQL Server 2005 Network Configuration->mssqlserver protocol in SQL Server 2005 Configuration Manager. If it is enabled, disable it. Then perform one of the above actions.
2. Whether remote connections are already allowed.
This section can be easily divided into 4 areas, namely, enabling remote connections on SQL Server, enabling the SQL Server browsing service, creating exceptions for SQL Server 2005 in Windows Firewall, and "SQLBrowser" in Windows Firewall Create an exception. Here are a few specific ways to do this, from MSDN.
To enable remote connections on a SQL Server instance
1. Point to Start Program->microsoft SQL Server 2005-> Configuration tool->sql Server surface Area Configuration
2. On the SQL Server 2005 Surface Area Configuration page, click the surface area Configuration for services and connections
3. Then click to expand Database Engine, select Remote connection, and on the right, select Local Area Connection and remote connection.
Then select the protocol you want to use (this place should enable the TCP/IP and Named Pipes service!). Click "Apply" and you will see the following message:
"Changes made to the connection settings will not take effect until the Database engine service is restarted. , click the OK button to return
4. Expand Database Engine, select Services, click Stop on the right, and wait until the MSSQLSERVER service stops.
Then click Start to restart the MSSQLServer service.
Enable the SQL Server Browser service
1. Point to Start Program->microsoft SQL Server 2005-> Configuration tool->sql Server surface Area Configuration
2. On the SQL Server 2005 Surface Area Configuration page, click the surface area Configuration for services and connections
3. Then click to expand SQL Server Browser, select Services, and on the right "startup type" select "Automatic",
Click Start, and then click OK to return
Create an exception for SQL Server 2005 in Windows Firewall
1. In the Windows Firewall Settings screen, select the Exceptions tab, and then click Add Program
2. In the Add Program window, click Browse
3. Then find "C:\ProgramFiles\Microsoft Files\Microsoft SQL Server\ Mssql.1 \mssql\binn\sqlserver.exe
In addition, it is important to note that when you define a connection string connectionstring in the Web. config file, the value of "server=" or "Data source=" is as much as possible with SQL Server The full name of 2005 remains the same (typically server=localhost\sqlexpress).
SQL Server 2005 does not allow remote connection resolution