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

Home > Search
  by

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:

  1. Select SQL Server Network Configuration
  2. Select Protocols for SQLEXPRESS
  3. Right click on Named Pipes and select Enabled
  4. Right click on TCP/IP and select Enabled
  5. Select SQL Server Services
  6. Right click on SQL Server Browser and select Properties
  7. Click on the Service Tab and set Start Mode to Automatic. Apply, OK.
  8. Right click SQL Server (SQLEXPRESS) and select Restart
  9. Right click SQL Server Browser and select Start

Then, create a login, and make the login a user.

  1. CREATE LOGIN username WITH PASSWORD = 'supersecretpassword'
  2. CREATE USER [username] FOR LOGIN [username]

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments