System.Data.SqlClient.SqlException:无法生成SQL Server的用户实例 [英] System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server
问题描述
System.Data.SqlClient.SqlException:由于启动用户实例的过程失败,因此无法生成SQL Server的用户实例。该连接将被关闭。
有人能收到此错误和/或对它的原因和/或解决方案有任何了解吗?
Anybody ever get this error and/or have any idea on it's cause and/or solution?
更新
连接字符串是 =。\SQLEXPRESS; AttachDbFilename = C:\temp\HelloWorldTest.mdf;集成安全性= True
建议的 User Instance = false
起作用。
推荐答案
问题的答案:
通常情况下,旧的用户实例会创建一些临时文件,这些文件会阻止创建新的SQL Express用户实例。删除这些文件后,所有内容将开始正常运行。
Very often old user instance creates some temp files that prevent a new SQL Express user instance to be created. When those files are deleted everything start working properly.
首先,通过在SQL Server Management Studio中运行以下SQL来确认已启用用户实例:
First of all confirm that user instances are enabled by running the following SQL in SQL Server Management Studio:
exec sp_configure 'user instances enabled', 1.
GO
Reconfigure
运行查询后,重新启动SQL Server实例。现在删除以下文件夹:
After running the query restart your SQL Server instance. Now delete the following folder:
C:\Documents and Settings\ {YOUR_USERNAME} \Local Settings\Application Data\Microsoft \Microsoft SQL Server数据\ {SQL_INSTANCE_NAME}
请确保您替换 {YOUR_USERNAME}
和 {SQL_INSTANCE_NAME}
并带有适当的名称。
Make sure that you replace {YOUR_USERNAME}
and {SQL_INSTANCE_NAME}
with the appropriate names.
来源:修复错误由于启动用户实例的过程失败,导致无法生成SQL Server用户实例。
这篇关于System.Data.SqlClient.SqlException:无法生成SQL Server的用户实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!