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

查看:151
本文介绍了错误:无法生成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_Data\CustomerDb.mdf;
     Integrated Security=True;
     User Instance=True'"
     providerName="System.Data.EntityClient" />

其他信息:

我在网上发现的一些关于此错误的引用不适用于我.例如,我看到的是尝试通过远程桌面启动用户实例时发生此错误的地方(我在本地执行此操作).另一个提示它与旧的Express安装中的剩余文件有关...我在指定的位置查看但未找到这些工件.我也尝试运行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\<user name>\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS.我以为我以前曾经寻找过,但是实际上我已经在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>\AppData\Local\Microsoft\Microsoft SQL Server Data\SQLEXPRESS. 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天全站免登陆