我该如何处理这个错误 [英] How can I handle this error

查看:112
本文介绍了我该如何处理这个错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于在急需的项目中复制数据库文件失败而无法生成sql server的用户实例



我尝试了什么:



我使用csharp 2010制作了一个项目,直到今天我才遇到上述问题

Failed to generate a user instance of sql server due to a failure in copying database files in a c sharp project

What I have tried:

I made a project using csharp 2010 and it used to work properly until today that I encountered the above problem

推荐答案

当您尝试从没有足够权限的文件夹中访问数据库文件时,通常会发生这种情况。请记住,SQL实例不会在您的用户ID下运行,因此如果您附加的MDF文件位于项目文件夹中,则SQL无法读取它。

尝试将文件移动到更多位置可访问的文件夹(这可能有所帮助:我应该在哪里存储我的数据? [ ^ ]并仔细检查文件夹权限。

将数据文件保存在你的app文件夹下无论如何都是个坏主意,因为它在生产中往往会失败,因为Program Files文件夹对你可以做的更加严格。它和它的子目录。
This generally happens when you try to ATTACH a DB file from a folder that doesn't have sufficient permissions. Remember that the SQL Instance doesn't run under your user ID, so if the MDF file you are attaching is in your project folder then SQL can't read it.
Try moving the file to a more accessible folder (this may help: Where should I store my data?[^] and double check the folder permissions.
Keeping data files under your app folder is a bad idea anyway, as it tends to fail in production because the Program Files folder is much more restrictive on what you can do with it and it's subdirectories.


这篇关于我该如何处理这个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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