0
votes

I'm using Visual Studio 2013 update 5 to connect to the SQL Azure database. I can do it without any issues from SQL Management Studio using the same host and connection string, but when I use Visual Studio (for example to publish my database project or generate sql script compare) I get the following error:


Microsoft Visual Studio

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

OK

enter image description here

Some additional input:

  • It seems that I start to get this error since I updated to Windows
      10.
  • Sql Azure firewall settings are configured properly (because I can connect from that host using Management Studio).
  • The Windows Firewall is switched off.
  • My Windows 10 is running in Parallels box on Mac OS X.

Please advise.

2
Are you 100% that the outgoing IP address hasn't changed given that your Win 10 is running through Parallels? Maybe the virtualised network is causing issues? Also can you show how the connection string is entered via the dialog in the question?Brendan Green
I'm 100% sure that from the same host and OS I can easily connect via SQL Management Studio and right after/before it I couldn't connect via Visual Studio database project (add connection feature)Alexey Strakh

2 Answers

2
votes

Try this way: Open Server Explorer --> Azure and find your database on the list. Right mouse click and execute Open SQL Server Object Explorer. If you have a network issue including Azure SQL Server Firewall rules setting, it will pop up a dialog box reporting it explicitly. The connection in SQL Server Object Explorer and Publish are working in the same way so you can make sure your Azure SQL Database can be connected via SQL Server Object Explorer and DB project.

In general for Azure SQL Database development, the latest update of SSDT preview provides more up-to-date feature support. You can download the latest preview update from https://msdn.microsoft.com/en-us/library/mt204009.aspx Check previous releases page for Visual Studio 2013.

I hope this resolves your issue.

-2
votes

you do not open sql service! Follow me, please, you are open to start -> service (or search "services.msc" print textbox) -> and then navigate to the "SQL Server" right click -> propertise Statup Type: select "Automatic" Service Status: select "Start" and then wait for it to conduct Booted run bar, you try drop in visual studio 2013 connection.