Sign in with Microsoft
Sign in or create an account.
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.


假設您已在在 Microsoft SQL Server Compact 4.0 中將提交的事務轉儲到磁片前,在連接字串中指定了 [ 清除間隔 ] 的秒數。 在這種情況下,承諾交易的時間可能需要比清洗間隔更長的時間,否則可能甚至無法清除到磁片。 此外,如果不正常的程式終止,也會發生資料遺失。


解決此問題的修復套裝程式含在 SQL Server Compact 4.0 Service Pack 1 的隨選熱修復程式更新套件中。 如需有關如何取得此針對 SQL Server Compact 4.0 的隨選熱修復程式更新套件的詳細資訊,請按一下下列文章編號,以查看 Microsoft 知識庫中的文章:

2960153 SQL Server Compact 4.0 Service Pack 1 的隨選熱修復程式更新套件


若要解決此問題,請使用 CommitMode 立即清除變更,而不是依賴 刷新間隔。 下列範例程式碼示範這項技術:conn.ConnectionString = "Data Source = c:\temp\SalesData.sdf; " conn.Open() Dim tx As SqlCeTransaction tx = conn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted) com = conn.CreateCommand() com.Transaction = tx Dim a As Integer a = 101 While (a <= 1000) com.CommandText = "insert into Orders values (" + Convert.ToString(a) + ", 'best', 200)" com.ExecuteNonQuery() a = a + 1 End While tx.Commit(CommitMode.Immediate)


Microsoft 已確認本篇文章<適用於>一節所列之 Microsoft 產品確實有上述問題。

Need more help?

Want more options?



Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!