2013-09-23 67 views
-1

我开发,并重新编译开始我的网站CTRL + F5 了错误:.NET服务器停止工作

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)

怎么能这样即使发生?

我没有改变任何东西。

我开始清空MVC应用程序,并使用CTRL + F5启动它,它工作。我重新启动我的主应用程序,仍然无法正常工作。该死的。

问题是,我没有更改任何连接字符串,任何在mssql服务器,没有重新启动任何东西。我只是像往常一样编译应用程序,它先说了一些有关Antlr3的内容,然后无法连接到服务器..更改了sql express的端口,它开始工作20分钟,并且再次停止工作..不理解。

+0

确保SQL Server启动并运行 –

+0

我的SQL Server配置管理器下检查,并且服务正在运行。我会尝试重新启动计算机。这真是bs。 –

+0

您的数据库是否可以在网络外访问?我想你需要添加SQL服务器到firefall应用程序才能在外面访问它。 – Viji

回答

0

我忘了[InitializeMembership]属性我HomeController.cs,并且它永远循环,因为我是用RolesMembership;)

0

这个错误是针对两类问题抛出的。

1)是否有正确的服务器和数据库的名称,等你的连接字符串..

Examble:Setting up connection string in ASP.NET to SQL SERVER

2)检查您的SQLSERVER开放,如果您的SQL服务器有任何其他系统请检查您的本地网络和另一个系统网络。

请参阅本solution

0

您的SQL服务器从Visual studio > View > server Explorer,测试连接和复制连接字符串从there.It将工作......我的猜测是,你有一个错误的连接字符串错误的实例..

+0

一切工作到现在为止如何?我现在在另一个端口上创建了另一个虚拟目录,并且一切又开始运行有什么意义? –

0

您的数据库是否可以在网络外访问?我想你需要添加SQL服务器到firefall应用程序才能在外面访问它。

要将SQLSERVR.EXE添加到Windows firefall

1. Go to Control Panel\System and Security\Windows Firewall\Allowed Programs. 
2. Click Allow another Program. 
3. Add SQL Server 
0

进入控制面板 - >管理工具 - >服务 - > SQLServer的。检查SQLServer以确保它已启动。