2011-02-16 44 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