Search code examples
asp.netmysqlmemoryrepeaterprotected

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


After being plagued over a year with the dredded "Attempted to read or write protected memory. This is often an indication that other memory is corrupt", I have finally found a fix on it!

Background: asp.net 4.0. Windows server 2003. Using MySQL database.

I used to randomly get this issue on a few pages, and coincidently, the pages had an asp.net repeater on it. I tried all sorts of recommendations, but they simply didn't work.


Solution

  • I was using system.data.odbc , with an odbc driver installed for all of my asp.net pages to interact with the database. Here comes the fix... I instead downloaded MySQL.data.dll, and used this library for my db. Voila! Problem fixed.