Visual Studio - Resolve "Could not open a connection to SQL Server"

by
Jeremy Canfield |
Updated: March 12 2020
| Visual Studio articles
This error can appear in many places, such as a .PHP web browser, a Command Line Prompt, Adminer, and SQL Server Management Studio.
This error might only appear after resolving error No extension. None of the supported PHP extensions (SQLSRV, MSSQL) are available..
Steps to Resolve: In SQL Server Configuration Manager:
- Select SQL Server Network Configuration
- Select Protocols for SQLEXPRESS
- Right click on Named Pipes and select Enabled
- Right click on TCP/IP and select Enabled
- Select SQL Server Services
- Right click on SQL Server Browser and select Properties
- Click on the Service Tab and set Start Mode to Automatic. Apply, OK.
- Right click SQL Server (SQLEXPRESS) and select Restart
- Right click SQL Server Browser and select Start
Then, create a login, and make the login a user.
- CREATE LOGIN username WITH PASSWORD = 'supersecretpassword'
- CREATE USER [username] FOR LOGIN [username]
Did you find this article helpful?
If so, consider buying me a coffee over at