I'm running Visual Studio 2013 VB .Net on Windows 8 and I'm unable to Open a connection to any of the remote SQL Server databases that I can otherwise connect to via SQLServer Management Studio.
Specifically, I'm receiving the two errors below, and I can't determine why I cannot Open a connection:
The server was not found or was not accessible. Verify that the instance name is correct and that the SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A Non-recoverable error occurred during database lookup.)
and
..... (provider: SQL Network Interfaces, error: 25 - Connection string is not valid.)
My connection string is:
for error: 0
Integrated Security=SSPI;
Connect Timeout=20;
Persist Security Info=False;
Initial Catalog=SunSystemsData;
Data Source=tcp:svrsun07\MSSQLSERVER,1433;
for error: 25
Integrated Security=SSPI;
Connect Timeout=20;
Persist Security Info=False;
Initial Catalog=SunSystemsData;
Data Source=svrsun07\MSSQLSERVER;
I have confirmed the following:
- My servername is correct (I can connect to this in SQLMS and view the properties)
- My instancename is correct (I've used PortQuery to very this is the instance for my sever).
- My Database is set to Allow Remote Connections=True.
- My Client Protocols in Configuration Manager have both TCP/IP and Named Pipes Enabled.
- I have Permission to Connect and View and databases in SQLSMS.
- I've tried explicitly specifying Port 1433 but with no success.
- I've tried not specifying TCP and instead the Client uses Named Pipes and returns a Named Pipes 40 error.
- I've tried not using any instancename (i.e. just Data Source=svrsun07;) but with no success.
- I can ping the severname successfully.
Any suggestions are most welcome, thanks!