Reputation: 11911
I get this error message when I try to connect to Sql Server
===================================
Cannot connect to **SQL_ServerName**.
===================================
Instance failure. (System.Data)
------------------------------
Program Location:
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, Boolean isFirstTransparentAttempt, SqlAuthenticationMethod authType, Boolean disableTnir)
...
Upvotes: 3
Views: 14964
Reputation: 61
i solved it by stoped all server instance and just run the instance i work with it
1- open sql server configuration manager (if not shown in start menu it's in system32 ) .
2- select SQL Server Services you will get all instances that installed in your pc.
3- stop any instance you dont work with it and start the instance that you work with it.
Upvotes: 0
Reputation: 17
If you have got 2 instances, you take this error. I have MSSQLSERVER and SQL2005 instance name. And after windows server 2008r2 restart, the MSSQLSERVER is working but my default instance SQL2005 is not working. I check the system event log. It says about TCP connection is working another program or service. And I stopped MSSQLSERVER and my default instance SQL2005 started normally... This is port sharing problem.
Upvotes: 2
Reputation: 11911
The issue was I had two SQL server instance on the same machine.
Both instances were listening to connection on the same port, as describe in this forum
Open your Sql Server Configuration Manager
Go to SQL Server Network Configuration
and select Protocols for YOUR_INSTANCE
.
Right-click on TCP/IP
=>
Properties
Change the port from 1433
to another one. I changed it to 1434
.
Restart sql server and it should work.
Go to services
Find the instance you want to shutdown.
Right-click =>
Stop
Upvotes: 9