02 February 2007

SQL Server 2005 – Named Pipes Provider, Error 40


If you have SQL Server 2005 Express installed and you attempt to add a DataSource connection to a Visual Studio project, you may encounter the following error:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)
To fix this, follow these steps:
  1. Start by launching the SQL Server Configuration Manager.
  2. It can usually be found under the Microsoft SQL Server 2005/Configuration Tools/SQL Server Configuration Manager path. You will be presented with the SQL Server Configuration Manager control panel.
  3. Expand the "SQL Server 2005 Network Configuration" option.
  4. Select the "Protocols for ".
  5. In the right hand pane, there should be several options, one of which is "Named Pipes" and by default it should have a "Disabled" status.
  6. Right click the "Named Pipes" option.
  7. On the dropdown menu, select "Enable".
  8. You will receive a popup warning stating that the SQL service would have to be restarted in order for changes to take effect.
  9. Click "OK".
  10. The "Named Pipes" option will now show "Enabled", but we still have to restart the service to take effect.
  11. Now select the "SQL Server 2005 Services" option in the left hand panel.
  12. In the right hand panel, the "SQL Server ()" option should be visible.
  13. It's state should be "Running".
  14. Select the blue arrow on the button bar, indicated above.
  15. When you hover over this button, the context help should state "Restart service".
  16. Click this button to restart your SQL service and commit your changes.
  17. The service will be stopped and restarted.
  18. .

No comments:

Post a Comment

Comments are moderated only for the purpose of keeping pesky spammers at bay.

Microsoft Authentication Library (MSAL) Overview

The Microsoft Authentication Library (MSAL) is a powerful library designed to simplify the authentication process for applications that conn...