System.AccessViolationException

  • Thread starter Thread starter Michael P
  • Start date Start date
M

Michael P

I am using vb.Net 2008, SQL Server Compact 3.5, and a DataGridView control. This is an occassionally connected application. I am populating the DataGridView control from a DataTable that is filled with SqlServerCe.SqlCeDataAdapter.

The grid fills fine. I can click a few rows, scroll, filter, sort, etc. The events that are programmed all fire and work. Then, out of the blue, after maybe 5 or 6 row changes, I get an unhandled exception:

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

System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="System.Data.SqlServerCe"
StackTrace:
at System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr& ppUnknown)
at System.Data.SqlServerCe.SqlCeDataReader.ReleaseNativeInterfaces()
at System.Data.SqlServerCe.SqlCeDataReader.Dispose(Boolean disposing)
at System.Data.SqlServerCe.SqlCeDataReader.Finalize()
InnerException:


Can anybody explain this? From what I have read, it could be tied to any of the pieces I am playing with, that is why this is cross-posted. I am really stuck.

Thanks.
Mike
 
I am using vb.Net 2008, SQL Server Compact 3.5, and a DataGridView control. This is an occassionally connected application. I am populating the DataGridView  control from a DataTable that is filled with SqlServerCe.SqlCeDataAdapter.

The grid fills fine. I can click a few rows, scroll, filter, sort, etc. The events that are programmed all fire and work. Then, out of the blue, after maybe 5 or 6 row changes, I get an unhandled exception:

"Attempted to read or write protected memory. This is often an indicationthat other memory is corrupt."

System.AccessViolationException was unhandled
  Message="Attempted to read or write protected memory. This is oftenan indication that other memory is corrupt."
  Source="System.Data.SqlServerCe"
  StackTrace:
       at System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr& ppUnknown)
       at System.Data.SqlServerCe.SqlCeDataReader.ReleaseNativeInterfaces()
       at System.Data.SqlServerCe.SqlCeDataReader.Dispose(Booleandisposing)
       at System.Data.SqlServerCe.SqlCeDataReader.Finalize()
  InnerException:

Can anybody explain this? From what I have read, it could be tied to any of the pieces I am playing with, that is why this is cross-posted. I am really stuck.

Thanks.
Mike

Hi,
I came across that article on MS support site which provides a hotfix
though not being sure if it solves:
http://support.microsoft.com/kb/923028

and:
http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=6003

And you follow the comments on that thread:
http://forums.asp.net/t/675515.aspx

HTH,

Onur Güzel
 
I have the exact same situation and problem. It crashes at random - though
more often when you are exercising the db for sure. Does anyone have an
idea? my whole project will fall apart otherwise.

Chris
 
Back
Top