首先我有来自数据库的最新更新文件
DataTable excelData = ReadSCOOmega(lastUploadFile);
,在此迭代此数据之后
foreach (DataRow currentRow in rows)
{
currentRow.
}
是否可以在 foreach 循环中更改 da 数据。我可以仅访问该数据的值
currentRow.Field<object>("Some column name")
但不要更改它。我的想法已被选中。我在 excel 文件中有多个交易,当上传到数据库时,我需要在此文件中进行更改。是否可能或我需要将数据存储在其他文件中收藏?
最佳答案
你可以这样做:
foreach (DataRow currentRow in excelData.Rows)
{
currentRow.BeginEdit();
currentRow["ColumnName"] = value;
//.....
currentRow.EndEdit();
}
关于c# - 更改数据行字段值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37144871/