Attempted to read or write protected memory-Sql Compact and .NEt

Posted by Jankhana on Stack Overflow See other posts from Stack Overflow or by Jankhana
Published on 2010-03-11T08:22:16Z Indexed on 2010/03/12 11:47 UTC
Read the original article Hit count: 414

I'm using Sql Compact3.5 as my DB with C# .NET . I have a strange problem with my application. I'm running the code in two PC with same configuration except the Sql Compact installed. In one PC where Sql Compact3.5 is not installed I'm getting this strange error:

Exception :Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Inner Exception :

Stack Trace :

at System.Data.SqlServerCe.NativeMethods.CloseStore(IntPtr pSeStore) at System.Data.SqlServerCe.SqlCeConnection.ReleaseNativeInterfaces() at System.Data.SqlServerCe.SqlCeConnection.Dispose(Boolean disposing) at System.Data.SqlServerCe.SqlCeConnection.Finalize()

Source :

System.Data.SqlServerCe

I don't know where i have went wrong. I checked my code and included try catch everywhere. I'm handling Unhandled exception also using this . I am getting this error from a console application which I'm starting from Windows Form. In both the application I've inserted the Unhandled Exception coding and it's getting executed and getting return to the texxt file. But still Microsoft Don't Error Report is getting generated and I get that Dialog box!!!

Y still that dialog box is getting generated is the trouble!!! Is there any way to supress that Dialog box??? Y I'm getting this box when I'm handling the exception and it's executing my catch handler???

In another PC where SQL Compact is installed no error I get!!!

Any idea y is that so???

© Stack Overflow or respective owner

Related posts about c#

Related posts about sqlcompact