我在通过我创建的 WCF 服务连接到 Azure 上托管的 SQL 数据库时遇到问题。我通过单击 link 从 Azure 本身获取连接字符串。 .
我做过的事情:
- 将 WCF 服务的公共(public) IP 添加到数据库服务器的防火墙设置中。
- 允许访问 Azure 服务
- 尝试通过 VS2015 连接到 SQL Server,方法是单击 Tools>Open in Visual Studio
这是我的 ADO.NET(SQL 身份验证)连接字符串(如果有帮助的话):
Server=tcp:thebutlrserver.database.windows.net,1433;Data Source=thebutlrserver.database.windows.net;Initial Catalog=btlrDB;Persist Security Info=False;User ID=******;Password=******;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=120;
我遇到的错误是:
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)
最佳答案
大家好,我可以通过卸载或更改程序>打开或关闭 Windows 功能>en 启用所有功能来解决此问题
关于c# - 通过 WCF 服务使用连接字符串建立与 Azure SQL 数据库的连接时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38030869/