无法更新.mdf数据库,因为数据库是只读的

问题描述:





我用C#.net创建了一个数据库Windows应用程序。我的应用程序在windowsXp中成功运行,但它没有正确执行vista / Windows7系统。

我的应用程序显示无法更新.mdf数据库因为数据库是只读的这样的消息任何人都给我一个合适的解决方案。

首先:

任何人都给我一个合适的解决方案。

好吧,定义'适当的解决方案'。在那之后,不需要使用粗体。如果您有问题并且在这里寻求帮助,请稍微尊重。



现在:

无法更新.mdf数据库因为数据库是只读的

一个简单的 Google搜索 [ ^ ]可能会给你很多这样的链接:

类似讨论 [ ^ ]



基于你所说的和上面的讨论链接,Win7& Vista有一些额外的安全层,您需要为尝试访问数据库的用户提供适当的权限。这是一个安全配置问题。



(顺便说一句,我想,您应该在EventViewer中获取此特权问题的详细信息,并将其记录为错误。)
First of all:
Any one give me a proper solution.
Well, define 'proper solution'. After that, no need to use bold for it. If you have an issue and you are here for help, please be a little respectful.

Now:
"Failed to update .mdf database because the database is read-only"
A simple Google search[^] could had given you many links like this:
Similar discussion[^]

based on what you say, and the discussion link above, Win7 & Vista has some extra security layer and you need to give proper permissions to the user who is trying to access the database. It's a security configuration issue.

(BTW, I think, you should get the details of this privilege issue in EventViewer logged as an error.)

绑定为Vista的权限问题,不允许访问\ YourProjectPath \ App_Data



1)确保App_Data目录或任何包含的文件没有文件系统属性只读集。



2)确保您尝试连接的用户帐户具有对App_Data目录的修改控制权。



看看这个主题 [ ^ ]有一个完整的步骤(这是ASP.Net,但主体是相同的 - 只是在最后选择一个不同的用户帐户)
Bound to be a permissions issue with Vista not allowing access to \YourProjectPath\App_Data

1) Make sure App_Data directory or any contained files does not have file system attribute Read-only set.

2) Make sure the user account you are attempting to connect with has modify control over the App_Data directory.

Have a look at this thread[^] which has a full step-by-step (that's for ASP.Net, but the principal is the same - just choose a different user account at the end)




无法更新.mdf数据库。几个月前,在一个Windows项目中,我遇到了这个问题。

我用google搜索了一些关于这个主题的重要信息。



我会逐一理解它。

无论是XP,Vista还是Windows7。解决方案完全相同。



1.只需转到程序文件并找到已安装程序的文件夹。

2。只需右键单击文件夹中的.mdf文件,然后单击属性。

3.在PROPERTIES TAB中 - >安全 - >你会看到组或用户名。

4.在那里选择你想要授予文件访问权限的用户。

5.如果该用户允许的话未设置为完全控制。

6.更改权限 - >点击编辑。

7.现在,组或用户名框将打开。

8.在选择用户 - >在权限框中选择FULL CONTROL。

9.现在也按照日志文件的步骤操作。如果需要。



现在它可以工作..





谢谢你,

RAJASEKAR KALIDASSAN
Hi,
"Failed To Update .mdf Database." Some months before while in a windows project i came through this problem.
I googled enough and found some vital informations which i like share on this topic.

I'll put it one by one for easy understanding.
No matter whether its XP, Vista or Windows7. The Solution is all the same.

1. Just go to the program files and find the folder of the installed program.
2. Just right click the .mdf file in the folder and click PROPERTIES.
3. In PROPERTIES TAB -> SECURITY -> you'll see Group or Usernames.
4. In that select the User to which u want to give Access to the file.
5. If for that user the PERMISSION is not set to FULL CONTROL.
6. TO CHANGE PERMISSIONS -> CLICK EDIT.
7. Now the Group or Username box will open.
8. In that Select The User -> Select FULL CONTROL in Permission Box.
9. Now follow the steps for the log file too. IF Needed.

Now it'll Work..


Thank U,
RAJASEKAR KALIDASSAN