SQL Server CE - Internal error: Cannot open the shared memory region

微笑、不失礼 提交于 2019-11-30 21:34:02

You're right that the CE runtime has to be installed. And if you're using VS2010, you have to make sure that you install SP2 of the CE runtimes.

Even with that installed, I've run into this. In my case, I had a SQL Server CE instance acting as a local cache for a database using ADO.NET Synchronization Services. Is this your scenario?

I found that on test machines I got this error:

  • If the platform was Vista or Windows 7; and
  • If the SQL Server CE database was installed with the application to
    reside in a protected directory, such as C:\Program Files or C:\Program
    Files (x86); and
  • If the program was run using standard user credentials (i.e. not escalated to Administrator)

Workarounds for the condition included:

  • Running the application "as Administrator"; or
  • Configuring the application manifest to require Administrator credentials; or
  • Refactoring the application so that the .sdf file was located in an unprotected directory, such as C:\ProgramData[some subdirectory name] and modifying the connection string to point to that area; or
  • Relocating the entire application directory in a user space. For instance, in "Documents" or some similar space with full file access rights to the EXE and the .SDF file

    Obviously, each of those options has its disadvantages.

I had the same problem.

Windows 7.

It was because the user was in a Domain and the permissions where granted to "Everyone" and failed.

It must be granted to %DOMAIN%/Everyone

regards

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!