wpf 实例失败异常
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22602237/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Instance Failure Exception
提问by Mohini Mhetre
It was working still yesterday but now it is not working because sqlexpress service is stopped and it is not starting. I have connection string:
它昨天仍在工作,但现在它无法工作,因为 sqlexpress 服务已停止且未启动。我有连接字符串:
Data Source=.\SQLEXPRESS;
AttachDbFilename=C:\Program Files\Setup1\DB.mdf;
Integrated Security=True;
Connect Timeout=30;
User Instance=True
When I open this connection it throws exception Instance Failure. This is my WPF application and I am using .NET Framework 4.0.
当我打开这个连接时它抛出异常Instance Failure。这是我的 WPF 应用程序,我使用的是 .NET Framework 4.0。
采纳答案by Mohini Mhetre
I just stopped mssqlserver service and started sqlexpress service then sqlexpress service get started..now problem is that mssqlserver and sqlexpress both services cannot start simultaneously
我刚刚停止了 mssqlserver 服务并启动了 sqlexpress 服务然后 sqlexpress 服务开始了..现在的问题是 mssqlserver 和 sqlexpress 这两个服务无法同时启动
回答by Sajeetharan
@"Data Source=.\SQLEXPRESS;
AttachDbFilename=C:\Program Files\Setup1\DB.mdf;
Integrated Security=True;
Connect Timeout=30;
User Instance=True";
Make sure your SQL Server instance(MSSQLSERVER) is running.
确保您的 SQL Server 实例 (MSSQLSERVER) 正在运行。
To do this,
去做这个,
(i)Open run dialog box and type
(i) 打开运行对话框并输入
(ii)"services.msc" (without quotes) and hit Enter.
(ii)“services.msc”(不带引号)并按 Enter。
(ii)In Service Management Console you can check whether it is running or not.
(ii) 在服务管理控制台中,您可以检查它是否正在运行。
Or
或者
Try Deleting the folder C:\Users\User\AppData\Local\Microsoft\Microsoft SQL Server Data also restart VS after deleting the folder.
尝试删除文件夹 C:\Users\User\AppData\Local\Microsoft\Microsoft SQL Server Data 删除文件夹后也重新启动 VS。

