【发布时间】:2020-01-27 07:51:06
【问题描述】:
我正在使用 DataView。我从数据表中复制一些列并将其插入 DataView。由于某些要求,我需要添加一些重复的列。但是,它通过 DuplicateColumnName 异常。你能帮忙吗?有没有其他方法可以将 DataView 数据复制到 DataTable 中?
stringarr = new string[] { "ML#", "Address", "Purchaser","Address","Purchaser", "Sold Price", "State", "Taxes", "Town", "Zip", "District", "Section", "Block", "Lot", "Owner" };
DataTable distinctValues = new dataTable();
if (cbMLSDataType.SelectedIndex == 1)
{
distinctValues = view.ToTable(false, stringarr);
}
else if (cbMLSDataType.SelectedIndex == 2)
{
distinctValues = view.ToTable(false, stringarr);
}
【问题讨论】:
-
不能重命名吗?