Getting this error with your Sybase .NET driver? There is limited discussion that I found via Google, so I thought I would mention the solution here:
++++++++++++++++++++++++++++++++
ERROR Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at at Sybase.Data.AseClient.Unmanaged.ExecuteCommand(IntPtr pCommandHandle)
at Sybase.Data.AseClient.AseCommand.Execute()
at Sybase.Data.AseClient.AseCommand._ExecuteReader(CommandBehavior commandBehavior)
at Sybase.Data.AseClient.AseCommand.System.Data.IDbCommand.ExecuteReader()
++++++++++++++++++++++++++++++++
To fix this, contact Sybase and get the latest managed driver from August 2008:
Sybase.AdoNet2.AseClient.dll and Sybase.AdoNet.AseClient.dll
Version: 1.15.325.0
Released 15th August 2008
The difference between the 2 DLL’s is that one is for .Net 1.0 and the other for .NET 2.0.
This is apparently from the Sybase SDK, and Sorry, I can not provide this to you at all. Please contact Sybase!