1

enter image description hereI used the server name in ssms and typed in the server name of vs code to add a new connection, however, it shows mssql: Error: Unable to connect using the connection information provided. Retry profile creation? It no longer show error (mssql: Error 11001: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.))

enter image description here I also added new imbound rule at the firewall and allowed TCP port of 1433. I also changed all the TCP port in the Protocol to be 1433. Still, I wasn't able to connect the sql server to Visual Studio Code. Anyone can help me with this? What is the problem actually. It had no problem connecting to ssms at all but why won't it work with vs code?

PoolOfDeath20
  • 11
  • 1
  • 3
  • Does this answer your question? [Why am I getting "Cannot Connect to Server - A network-related or instance-specific error"?](https://stackoverflow.com/questions/18060667/why-am-i-getting-cannot-connect-to-server-a-network-related-or-instance-speci) – Filburt Feb 27 '20 at 17:06

1 Answers1

0

Some times SQl Instance stopped or Disabled running In Services

Go to Services find Sqlexpress or your Instance turn start

Services

Zanyar Jalal
  • 1,407
  • 12
  • 29