error|server| Program
Error : "When connecting to SQL Server 2005, the default setting for SQL Server to disallow remote connections may cause this failure. (provider: Named pipe provider, error:40-cannot open a connection to SQL Server) ",
These errors I encountered in two situations, one that pops up when you open open SQL Server 2005, and the other occurs when the application connects to SQL Server 2005. Summed up, for several reasons:
1. The database engine did not start.
There are two ways to start:
(1) Start-> program->microsoft SQL Server 2005->SQL Server 2005 peripheral configuration, click on the "Perimeter of Service Connection Configuration" in an open interface, and locate the database in an open interface Engine, click Services, see if it is started on the right, or click "Start" if it is not started, and make sure the "Startup Type" is automatic, not manual, otherwise start manually on the next boot;
(2) Open: Start-> program Microsoft SQL Server 2005-> Configuration Tool->sql Server Configuration Manager, select SQL Server 2005 Services MSSQLSERVER), and click the "Start Service" button in the toolbar to change the service status to start;
When you use both of these methods, sometimes you may get an error at startup, and you will need to see if via is enabled in the SQL Server 2005 Network Configuration->mssqlserver protocol in SQL Server 2005 Configuration Manager. If enabled, disable it. And then do one of these things.
2. Remote connections are allowed when remote connections are made.
SQL Server 2005 is restricted to local connections by default. We can manually enable remote connections. In the first of the above, locate the database Engine, click Remote Connections, and on the right, change local Area Connection (L) to local and remote connections (R) and select "Use both TCP/IP and Named Pipes (B)."
3. If it is a remote connection, you will also want to see if the statement connecting the database is correct, whether the login account is correct, the password is correct, and so on.
When I connect to a database in a local area network, because of the connection string out of the question, in a local area network of a machine connected to another computer database, the server= equipped with the database of another computer IP. I always have the error when I connect to the database, and after a long time, I found that IP is not correctly uploaded to the connection string, originally I was connected, using the local, that is, 127.0.0.1, the input of the IP did not pass to the connection string.
These are some of the cases I have summed up, I hope to be able to meet similar problems with friends to provide some help and reference.