Attempt to Read or write protected memory

Dec 5 2016 5:57 AM
Environment:  
OS: Win2102R2 std.
visual studio 2010.  
Oracle 12c.
 
The below error happens when we try to run a query which returns the pseudocolumn of  a row, This runs fine from sql developer. But from application the below error happens. I had tried many things from internet but nothing worked. 
 
Query: select d.rowid from DataView d where d.ID = :id
 
Stack Trace:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at Oracle.DataAccess.Client.OpsSql.ExecuteReader(IntPtr opsConCtx, IntPtr& opsErrCtx, IntPtr& opsSqlCtx, IntPtr& opsDacCtx, IntPtr& opsReaderErrCtx, IntPtr opsSubscrCtx, Int32& isSubscrRegistered, Int32 bchgNTFNExcludeRowidInfo, Int32 bQueryBasedNTFNRegistration, Int64& query_id, OpoSqlValCtx*& pOpoSqlValCtx, String pCommandText, OpoDacValCtx*& pOpoDacValCtx, IntPtr[] pOpoPrmValCtx, String[] ppOpoPrmRefCtx, OpoMetValCtx*& pOpoMetValCtx, Int32 NoOfParams)
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.DataAccess.Client.OracleCommand.ExecuteReader()
at CambridgeSoft.COE.Framework.Caching.OracleCacheDependency.AssociateCommand() in E:\ENotebook\EN1263\ChemOfficeEnterprise\Framework\CambridgeSoft\ServiceTier\CambridgeSoft.COE.Framework\Caching\OracleCacheDependency.cs:line 63
at CambridgeSoft.COE.Framework.Caching.OracleCacheDependency..ctor(OracleCommand cmd) in E:\ENotebook\EN1263\ChemOfficeEnterprise\Framework\CambridgeSoft\ServiceTier\CambridgeSoft.COE.Framework\Caching\OracleCacheDependency.cs:line 28
at CambridgeSoft.COE.Framework.COEFormService.OracleDataAccessClientDAL.GetCacheDependency(Int32 id) in E:\ENotebook\EN1263\ChemOfficeEnterprise\Framework\CambridgeSoft\ServiceTier\CambridgeSoft.COE.Framework\Form\DAL\OracleDataAccessClientDAL.cs:line 55
at CambridgeSoft.COE.Framework.COEFormService.COEFormBO.FetchObject(SafeDataReader dr) in E:\ENotebook\EN1263\ChemOfficeEnterprise\Framework\CambridgeSoft\ServiceTier\CambridgeSoft.COE.Framework\Form\BLL\COEFormBO.cs:line 1113
at CambridgeSoft.COE.Framework.COEFormService.COEFormBO.DataPortal_Fetch(Criteria criteria) in E:\ENotebook\EN1263\ChemOfficeEnterprise\Framework\CambridgeSoft\ServiceTier\CambridgeSoft.COE.Framework\Form\BLL\COEFormBO.cs:line 1081

Answers (1)