SQL Server Error “A Network Related or instance-specific Error: 40”
SQL Server Error “A Network Related or instance-specific Error: 40”
Problem description
|
When trying to make a connection from Visual Studio Entity Framework Connection Wizard to the local instance of the SQL Server - You get The Error: 40
|
- Make sure that the SQL Server is configured to Allow remote connections (go to SQL Server Management Studio > Properties > Connections)
- Make sure that the firewall is opened:
netsh firewall set portopening protocol = TCP port = 1433 name = SQLPort mode = ENABLE scope = SUBNET profile = CURRENT
- Open Sql Server Configuration Manager and SQL Server Services and make sure that the SQL Server Browser is up and running
- Go to Protocols for YOURINSTANCE
- Right click on TCP/IP (make sure it’s Enabled) and go to properties
- Select the IP Address tab and scroll down to the bottom
- If the TCP Port is empty then make sure to enter 1433
- Now hit Apply and OK and restart your instance
- Go to SQL Server Services, find SQL Server (YOURINSTANCE) right click and restart
- Netstat -ano will now show the port 1433 LISTENING
- If you now test the connection it should be successful
Comments
Post a Comment