问题描述
vs2010 中的 net 项目我在 app_data 文件夹中有一个 db 和表,我创建了一个部署包并将该包导入到安装在我的本地机器上的 iis 服务器中.现在我在尝试执行插入时收到此错误消息.
net project in vs2010 i have a db and table inside the app_data folder, i have created a deployment package and have imported the package into an iis server that is installed on my local mechine. now i get this error message while trying to preform an insertion.
由于检索用户的本地应用程序数据路径失败,无法生成 SQL Server 的用户实例.请确保用户在计算机上有本地用户配置文件.连接将被关闭
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed
连接字符串是:
数据源=.SQLEXPRESS;AttachDbFilename=|DataDirectory|survey.mdf;Integrated Security=True;User Instance=True
Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|survey.mdf;Integrated Security=True;User Instance=True
在 VS2010 中运行时它工作正常.
when running it inside VS2010 it`s working fine.
我该如何解决这个问题?
how can i solve this probelm ?
推荐答案
移除 User Instance=True
.您不需要 RANU 实例.接下来,确保 SQL Server Express 服务帐户 具有适当的所需权限在你的 app_data 上:
Remove the User Instance=True
. You don't need RANU instances. Next, make sure the SQL Server Express service account had the proper needed rights on your app_data:
cacls <pathapp_data> /E /T /G SQLServerMSSQLUser$<ComputerName>$SQLEXPRESS:F
这篇关于由于检索用户的本地应用程序数据路径失败,无法生成 SQL Server 的用户实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!