I have a SQL Server CE database that works fine in dev, but when installed on the client has an issue.
The message for the exception in the event log is:
Message: Internal error: Cannot open the shared memory region.
Stack Trace: at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr) at
System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent) at
System.Data.SqlServerCe.SqlCeConnection.Open() at
System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) at
System.Data.Linq.SqlClient.SqlProvider.Execute(
Expression query,
QueryInfo queryInfo,
IObjectReaderFactory factory,
Object[] parentArgs,
Object[] userArgs,
ICompiledSubQuery[] subQueries,
Object lastResult) at
System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(
Expression query,
QueryInfo[] queryInfos,
IObjectReaderFactory factory,
Object[] userArguments,
ICompiledSubQuery[]
subQueries) at
System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(
Expression query) at
System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at
System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at
Application specific stuff here
It looks like this is SSCE_M_CANTOPENSHAREDMEMORY and the site says there isn't a connection string value to change this and that these issues are typically not resolvable by the end developers.
Has anyone run into this, and if so were you able to resolve this issue?
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With