禁止DataTable的更改跟踪 [英] Disable DataTable change tracking
问题描述
有没有办法有数据表进行修改行时自动接受更改,或只是禁用更改跟踪?
Is there a way to have data tables automatically accept changes or just disable change tracking when making modifications to rows?
当更改到DataTable,忘记叫 DataTable.AcceptChanges()
可能会导致真正的问题。
When making changes to a datatable, forgetting to call DataTable.AcceptChanges()
can cause a real problem.
推荐答案
我觉得整点数据表
是有加行版本控制和变更跟踪的好处。我不认为你其实可以禁用此行为。从 MSDN :
I think the whole point of a DataTable
is to have the added benefits of row versioning and change tracking. I do not think you can actually disable this behavior. From MSDN:
每个的DataRow集合中表示在表中的一行数据。
。要提交修改,该行一列中的值,必须
调用AcceptChanges方法。
Each DataRow in the collection represents a row of data in the table. To commit a change to the value of a column in the row, you must invoke the AcceptChanges method.
是否要禁用行特定的场合完全或仅版本?
Do you want to disable row versioning completely or only in specific occasions?
这篇关于禁止DataTable的更改跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!