试图读取或写入受保护的内存,SQL精简和.NET [英] Attempted to read or write protected memory-Sql Compact and .NEt

查看:191
本文介绍了试图读取或写入受保护的内存,SQL精简和.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行该应用程序在两种情况下:在安装SQL Server精简版(3.5),一个没有。如果没有安装SQL Server精简版,我收到以下错误:

I've tried to run the application in two situations: with SQL Server compact edition (3.5) installed and one without. When SQL Server Compact edition isn't installed, I get the following 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'm handling Unhandled exceptions using this method.

我是从我的Windows窗体启动控制台应用程序收到此错误。在这两个应用程序,我插了未处理的异常编码和它得到执行和被退回到文本文件,并如何产生的微软报告错误对话框;我该如何让这样的事情发生?如何排除是什么原因造成这个问题?

I am getting this error from a console application which I'm starting from a Windows Form. In both the application I've inserted the Unhandled Exception coding and it's getting executed and getting returned to the text file, and the Microsoft 'report error' dialog is getting generated; how do I keep that from happening? How do I troubleshoot what is causing this issue?

推荐答案

我解决了这个错误!这是不是真的SqlCompact错误或异常从code.It是GAC这是throwingit BEC我打开为了某种目的而另一个应用程序,该应用程序正在访问数据库。在当应用程序被关闭它明确得到从父应用程序杀了那么错误是未来的SQL紧凑型数据库的时间。所以,ADE在我的code一些变化,它现在的工作!感谢您的建议。

I solved that error!!! It was not really SqlCompact error or Exception from code.It was GAC that was throwingit bec I was opening another application for some purpose and that app was accessing the Database. At time when that app was closing the DB it was explicitly getting killed from the parent app so the error was coming for SQL COMPACT. so I ,ade few changes in my code and it's working now!!! Thanks for all your suggestions.

这篇关于试图读取或写入受保护的内存,SQL精简和.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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