Attempted to read or write protected memory. This is often an indication that other memory is co
Hi All,
I am working on winforms 2.0 with vs 2005 standard edition( windows Xp service pack 2). I am using enterprise library 3.0 caching application block for caching data .I used nullcache for caching storage type. I am using cached data particularly for to populate combobox data. When ever a screen which opened in my application having combobox that time I am storing all the data in caching as follows:
string cacheKey = key.ToString() + languageId.ToString();dsLookupResourcesFromCache = (
DataSet)cManager.GetData(cacheKey);if (dsLookupResourcesFromCache !=null){
return dsLookupResourcesFromCache;}
else{
HolcimBL.
CommonBL cacheBL =newCommonBL();dsLookupResourcesFromCache = cacheBL.GetLookupResources(languageId);
cManager.Add(cacheKey, dsLookupResourcesFromCache,
CacheItemPriority.High,new HolcimUI.CommandDataCacheRefreshAction(),newSlidingTime(TimeSpan.FromMinutes(10)));return dsLookupResourcesFromCache;}
The above code will return the tables for all combobox in my forms.
In some of my screens I am adding new data and removing some old data for the comboboxes through other screens. When I insert new data
I am clearing the cache by using :
cManager.Flush();
and then again inserting the new data in the cache manager.
I closed the forms which inserted some data for the combobox datasource after that i am opening the forms which are having the comboboxes. In those forms i am getting the data with respect to the changes done in the data forms. But when I am changing the index for the comboboxes I am getting the exception like this:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Can anybody please give suggestions on this.
Lot of thanks.

