错误:无法生成 SQL Server 的用户实例 [英] Error: Failed to generate a user instance of SQL Server

查看:47
本文介绍了错误:无法生成 SQL Server 的用户实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接到 MDF.我什至不遗余力地重新安装了 sql server express(它现在是我的盒子上安装的唯一一种 SQL,以前我有 05 dev 和 express).我已经验证了路径都是正确的,到目前为止我的 google-fu 没有帮助.

I'm trying to connect to an MDF. I've even gone to the lengths of re-installing sql server express entirely (it is now the only flavor of SQL installed on my box, where previously I had 05 dev and express). I've verified that the paths are all correct, and thus far my google-fu hasn't helped.

完整的异常消息是:

由于发生故障,未能生成 SQL Server 的用户实例启动用户实例的进程.连接将是关闭.

Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.

连接字符串是:

<add name= "CustomerEntities"
     connectionString="metadata=res://*/Data.CustomerModel.csdl|res://*/Data.CustomerModel.ssdl|res://*/Data.CustomerModel.msl;
     provider=System.Data.SqlClient;
     provider connection string='Data Source=.SQLEXPRESS;
     AttachDbFilename=App_DataCustomerDb.mdf;
     Integrated Security=True;
     User Instance=True'"
     providerName="System.Data.EntityClient" />

附加信息:

我在网上找到的一些关于此错误的引用不适用于我.例如,我看到的一个错误是在尝试通过远程桌面启动用户实例时发生此错误(我在本地执行此操作).而另一个建议它与旧快速安装的剩余文件有关......我查看了规定的位置并没有找到那些工件.我还尝试运行 sp_configure 'user instances enabled', '1',但它说它已经设置为 1.

Additional info:

Several of the references to this error I've found online do not apply to me. For example, one I've seen is where this error occurs when trying to start the user instance over remote desktop (I'm doing this locally). While another suggests that it has to do with leftover files from an old express installation ... I've looked in the prescribed locations and not found those artifacts. I also tried running sp_configure 'user instances enabled', '1', but it said that it was already set to 1.

推荐答案

好的,现在可以了!猜想这是一个复合问题......我为解决它所采取的步骤是这样的:

ok, it works now! guess it was a compound problem ... the steps I took to resolve it are as such:

  1. 更改了连接字符串中的以下属性(注意细微差别):AttachDbFilename=|DataDirectory|CustomerDb.mdf;
  2. 删除了以下目录的内容:c:Users<用户名>AppDataLocalMicrosoftMicrosoft SQL Server DataSQLEXPRESS.我以为我以前找过这个,但实际上我查看了 Microsoft Sql Server 文件夹.同样,细微的差别.
  1. Changed the following property in the connection string (note the subtle difference): AttachDbFilename=|DataDirectory|CustomerDb.mdf;
  2. Deleted the contents of the following directory: c:Users<user name>AppDataLocalMicrosoftMicrosoft SQL Server DataSQLEXPRESS. I thought I had looked for this before, but I had actually looked in the Microsoft Sql Server folder. Again, a subtle difference.

一旦我做了这两件事,连接就开始工作了:-D

Once I did these two things, the connection started working :-D

这篇关于错误:无法生成 SQL Server 的用户实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆