有谁知道我的代码在哪里出错了?这段代码工作得很好,但是我将文件传输到另一台计算机,当我编译文件时弹出这个错误。
private void ShowGeneratedSchedule(string sLocationName, string sAllocationDate)
{
//lstAllocation = db.allocations.Where(a => a.AllocationDate == sAllocationDate &&
// a.LocationName == sLocationName).ToList();
scheduleDGV.EditMode = DataGridViewEditMode.EditProgrammatically;
for (int i = 0; i < lstAllocation.Count; i++)
{
for (int j = 0; j < scheduleDGV.Rows.Count - 1; j++)
{
for (int k = 0; k < scheduleDGV.Columns.Count; k++)
{
if (scheduleDGV[0, j].Value.Equals(lstAllocation[i].LocationName) &&
scheduleDGV[1, j].Value.Equals(lstAllocation[i].StationName) &&
scheduleDGV.Columns[k].HeaderText.Equals(lstAllocation[i].AllocationTime.ToString()))
{
if (lstAllocation[i].EmployeeName != null)
{
scheduleDGV[k, j].Value = lstAllocation[i].EmployeeName;
}
}
}
}
}
//scheduleDGV.DataSource = lstEmployeeSlot;
}
到达此行时显示错误,
for (int i = 0; i < lstAllocation.Count; i++)
有谁知道这里有什么问题?是否有可能将其转移到另一台计算机上?