C# 如何访问强类型DataRow的原始版本和修改版本?

C# 如何访问强类型DataRow的原始版本和修改版本?,c#,dataset,strongly-typed-dataset,unit-of-work,C#,Dataset,Strongly Typed Dataset,Unit Of Work,我正在编写代码来模拟winforms over Data Sets应用程序中的工作单元模式 我有以下资料: foreach (EomApp1.Formss.Accounting.Data.AccountingView.AccountingViewRow in accountingView.GetChanges(DataRowState.Modified).Tables[0].Rows) { // brea

我正在编写代码来模拟winforms over Data Sets应用程序中的工作单元模式

我有以下资料:

foreach (EomApp1.Formss.Accounting.Data.AccountingView.AccountingViewRow 
                in accountingView.GetChanges(DataRowState.Modified).Tables[0].Rows)
            {
                 // break point -> immediate window
即时窗口:

modified.Tables[0].Rows[0]["Cost/Unit", DataRowVersion.Original]
1
modified.Tables[0].Rows[0]["Cost/Unit", DataRowVersion.Current]
0

是否有任何方法可以使用强类型数据集访问上述信息?(在我的示例中,accountingView,但我不知道如何在不使用列的字符串名称的情况下获取更改的DataRowVersion对象。

据我所知,没有。
要摆脱神奇的弦,您可以执行以下操作

modified.Tables[0].Rows[0][Tables[0].CostUnitColumn.ColumnName, DataRowVersion.Current]
System.Data.DataSetExtensions
程序集中的扩展方法是否为您解决了这个问题?请注意
DataColumn
DataRowVersion
的参数