List<String> employeeTimings;
public string[] sTime = {"0000", "0030", "0100", "0130", "0200", "0230", "0300", "0330", "0400", "0430", "0500", "0530", "0600", "0630", "0700", "0730", "0800", "0830", "0900", "0930", "1000", "1030", "1100", "1130", "1200",
"1230", "1300", "1330", "1400", "1430", "1500", "1530", "1600", "1630", "1700", "1730", "1800", "1830", "1900", "1930", "2000", "2030", "2100", "2130", "2200", "2230", "2300", "2330"};
employeeTimings = new List<String>(sTime);
int i=0;
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("Location", typeof(string)));
dt.Columns.Add(new DataColumn("Station", typeof(string)));
foreach (DataColumn dc in dt.Columns)
{
dt.Columns.Add(employeeTimings[i], typeof(string));
i++;
}
SchedulingTableDGV.DataSource = dt;
我收到错误“集合已修改;枚举操作可能无法执行。” 我该如何解决这个问题?