在部署Windows应用程序后拒绝访问.ddf Db文件 [英] Access Denied To .Sdf Db File After I Deployed The Windows Application

查看:78
本文介绍了在部署Windows应用程序后拒绝访问.ddf Db文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用sql compact edition [.sdf文件]作为我的数据库,我将应用程序安装在另一个系统中,但是对db文件的访问被拒绝,我如何在连接字符串中设置访问权限?

解决方案

它可能不是您的连接字符串:它可能是您将文件部署到的位置。

如果您将它放在应用程序文件夹中,然后它会在你的开发系统上很好,但它会在生产中失败,因为出于安全原因,普通用户没有对Program Files目录下的文件夹的写访问权。

看看这个:我应该在哪里存储数据? [ ^ ] - 它提出了一些更好的选择

I used the sql compact edition [.sdf file] as my database, and i installed the application in another system, but the access to the db file is denied, how can i set the access in the connection string ?

解决方案

It may not be your connection string: it may well be where you deployed the file to.
If you put it in the application folder, then it will owrk fine on your development system, but it will fail in production because normal users don't have write access to folders under the Program Files directory for security reasons.
Have a look at this: Where should I store my data?[^] - it suggests some better options.


这篇关于在部署Windows应用程序后拒绝访问.ddf Db文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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