Which are necessary steps to connect to an Azure SQL database in Visual Studio or SQL Server Management Studio?

大城市里の小女人 提交于 2021-01-29 02:29:33

问题


I am using Visual Studio 2013 with update 5. I created a SQL database on Azure.

Now I am trying to connect to it in VS and SQL Server Management Studio, but I get this error

Error : Connect to Server

Cannot connect to MyServerName.database.windows.net.

ADDITIONAL INFORMATION:

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) (Microsoft SQL Server, Error: 53)

The network path was not found

Before connecting to Azure SQL I have taken these steps:

  • Added machine's IP in SQL Azure firewall
  • Opened port 1433 by adding a new outbound rule in firewall on my local machine

I want know which step I missing in whole process.


回答1:


Well. This is hapenning because tha address you're using isn't ok to access. Try to connect through the IP, and make sure you're using the PUBLIC IP/DNS. Try to open the firewall on both sides. That's all that I could help you with the information error reported for you. The conection string that you're using is not ok or not accessible.




回答2:


VS2013 and above has a decent cloud explorer screen, I'd recommend navigating to the resource through that first. You can also use the Server Explorer to navigate to the right resource and open in in SQL Server Object Explorer. That will at least eliminate if it's an issue with your stored credentials.



来源:https://stackoverflow.com/questions/34809405/which-are-necessary-steps-to-connect-to-an-azure-sql-database-in-visual-studio-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!