【发布时间】:2015-09-16 05:55:10
【问题描述】:
DataTable exportTable = new DataTable();
exportTable.Columns.Add("Place", typeof(string));
exportTable.Columns.Add("Day", typeof(string));
foreach (var time in timeList)
{
exportTable.Columns.Add(time, typeof(string));
}
exportTable.Rows.Add("New York", 1/1/2015, ?, ?, ?, ...);
如何动态填充 DataTable 中的一行?
【问题讨论】:
-
您需要创建一个
DataRow才能插入。 An example may be seen here -
你想从什么来源填充行?