ASP.NET error – Attempted to read or write protected memory

Right, first post of 2009, let’s start off with a shot one.

As part of my job, I am now learning and using ASP.NET with C#. The other day I was firing off some queries to an ODBC data source when I came across this exception message:

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

Turns out the problem was caused by the number of parameters I added to the prepared ODBC command – what I am saying is, check you OdbcCommand’s parameter count against the expected parameter count, make sure nothing is missing.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: