Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 dataTables DTsource、DTtarget 和 DTdiff
DTsource.Merge(DTtarget); DTsource.AcceptChanges(); DTdiff=DTsource.GetChanges();
源和目标中有不同的记录集。但 DTdiff 始终为 null。请任何指点......
很明显你应该这样做:
DTsource.AcceptChanges(); DTsource.Merge(DTtarget); DTdiff=DTsource.GetChanges();
在合并之前接受所有先前的更改。合并后,GetChanges 只包含目标的差异。