通过网络共享的SQL CE [英] SQL CE over a network share

查看:76
本文介绍了通过网络共享的SQL CE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前已经看到过这个问题,但是找不到关于什么是/不可能,什么解决方法可用的清晰解释.

I have seen this question asked previously but can not find a clear explanation of what is/isn't possible and what workarounds migth be available.

我有一个使用SQL CE来存储本地信息的现有C#应用程序.该数据库只能由单个应用程序访问,并存储在用户的appdata文件夹中.

I have an existing C# application that uses SQL CE to store local information. This database is only accessed by a single application and is stored in the user's appdata folder.

某些环境将appdata文件夹重定向到网络共享,这导致SQL CE引发异常:内部错误:无法打开共享内存区域."

Some environments have the appdata folder redirected to a network share which causes SQL CE to throw an exception: "Internal error: Cannot open the shared memory region."

我已经阅读到SQL CE 3.5 SP2应该允许再次连接到网络共享,而SP1不允许,但是我无法使其正常工作.是否有人成功获得了任何版本的SQL CE都可以通过网络共享工作?如果是这样,您使用什么版本/代码使其正常工作?

I have read that SQL CE 3.5 SP2 is supposed to allow connections to network shares again, and that SP1 does not, however I have not been able to get it to work. Has anybody had any success getting any version of SQL CE to work over a network share? And if so, what version/code did you use to get it to work?

我尝试在连接字符串中使用mode = Exclusive,但是没有运气.

I have tried using mode=Exclusive in the connection string with no luck.

或者,有人找到了不同的解决方法吗?数据需要存储在用户的配置文件中,因为每个用户都是特定的,并且系统上的其他任何用户都不能访问该数据.

Or alternatively, has anybody found a different workaround? The data needs to be stored in the user's profile as it is specific per user and should not be accessible by any other user on the system.

推荐答案

我更新了应用程序,以将SQL Express与可以工作的本地用户实例一起使用,但是这给我们的客户带来了太多的部署问题.当我们研究不同的数据库选项时,我最终不得不编写一个层来使用Access MDB.

I updated the application to use SQL Express with local user instances which worked, but it created too many deployment issues for our customers. I ended up having to write a layer to use Access MDBs while we look at different database options.

我对编写桌面应用程序的建议是不要将SQL Express或SQL CE用于本地存储.

My suggestion for writing desktop applications is DO NOT use SQL express or SQL CE for local storage.

这篇关于通过网络共享的SQL CE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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