2011-02-16 82 views
0

在我们的wpf windows应用程序中,我们使用sql server ce在插入,删除时存储数据。有些时候,它工作正常,但有时后,它给予访问冲突异常。以下是一个堆栈跟踪:sqlserver紧凑版中的accessViolation异常

enter image description here

请推荐?如何解决这个问题,因为应用程序正在关闭?

在System.Data.SqlServerCe.NativeMethods.SafeRelease(IntPtr的& ppUnknown) 在System.Data.SqlServerCe.SqlCeDataReader.ReleaseNativeInterfaces() 在System.Data.SqlServerCe.SqlCeDataReader.Dispose(布尔处置) 在系统.Data.SqlServerCe.SqlCeDataReader.Close() at System.Data.Common.DbDataReader.Dispose(Boolean disposing) at System.Data.Common.DbDataReader.Dispose() at System.Data.Common.Internal.Materialization。整形1.Finally() at System.Data.Common.Internal.Materialization.Shaper 1.SimpleEnumerator.Dispose() 在System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext() 在ParentalHealthServiceBL。 DataAccess.HealthMonitorDAO.GetUserCOPDReadings(Int32 userID,String datearameter)在d:\ projectParentalHealth \ trunk \ src \ ParentalHealth \ ParentalHealthServiceBL \ DataAccess \ HealthMonitorDAO.cs中:第1355行 位于ParentalHealthClient.DataAccess.HealthMonitorDAO.GetUserCOPDReadings(Int32 userID,String strFilter)在d:\ projectParentalHealth \ trunk \ src \ ParentalHealth \ ParentalHealthClient \ DataAccess \ HealthMonitorDAO.cs:line 46

谢谢!

回答

0

您是否正在使用来自不同线程的SQL CE?只有版本4支持并发访问。如果你没有,那么你使用的是不支持的并发访问一个版本的显式安装版本4(Download here)。

+0

是的。我正在使用SQL CE 3.5版。 – Tarun 2011-02-17 05:19:03