2016-05-10 49 views
1

首先我最后一次更新文件从DB更改数据行的字段值

DataTable excelData = ReadSCOOmega(lastUploadFile); 

,这个遍历这个数据后

foreach (DataRow currentRow in rows) 
{ 
    currentRow. 
} 

这有可能改变在foreach loop.I DA数据只能访问在这个数据

currentRow.Field<object>("Some column name") 

但不是价值变动it.My想法被选中。我在excel文件中有多个交易,何时上传到数据库,我需要对此文件进行更改。是否有可能或者我需要将数据存储在其他集合中?

回答

3

你可以这样做:

foreach (DataRow currentRow in excelData.Rows) 
{ 
    currentRow.BeginEdit(); 
    currentRow["ColumnName"] = value; 
    //..... 
    currentRow.EndEdit(); 
}