相关疑难解决方法(0)

Azure网站无法访问Azure DB

这个错误让我发疯,我甚至无法重现它!

我已将我的网站发布到Windows Azure和SQL Azure,它运行良好.突然间,它不起作用,我得到这个令人讨厌的错误:

这是我得到的错误:

http://jsfiddle.net/shimmy/pcS7g/embedded/result

这是错误:

建立与SQL Server的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称是否正确,以及SQL Server是否配置为允许远程连接.(提供程序:SQL网络接口,错误:26 - 查找指定的服务器/实例时出错)

我想强调一下,我可以通过SSMS或VS访问SQL并查看我的表等.

我不知道是什么导致每次部署后一次又一次地发生这种恼人的错误.

堆栈跟踪:

[SqlException (0x80131904): 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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5295167
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) …
Run Code Online (Sandbox Code Playgroud)

web-config azure azure-storage azure-web-sites azure-sql-database

10
推荐指数
2
解决办法
5903
查看次数

检索使用C#.NET链接到Windows Azure网站的SQL Azure数据库的连接字符串

Windows Azure网站的配置页面具有"连接字符串"部分.该部分列出了链接资源的连接字符串.我们如何以编程方式检索链接的SQL Azure数据库的连接字符串?

c# asp.net azure

4
推荐指数
1
解决办法
2427
查看次数