我有兩份名單,我想將數據從一個到另一個複製和我得到這個錯誤:列表索引錯誤:索引超出範圍
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
這裏是我的代碼:
static IList<Common.Data.Driver> Stt_driverList = new List<Common.Data.Driver>();
List<Common.Data.Driver> driverList = new List<Common.Data.Driver>();
for (int i = 0; i < driverList.Count; i++)
{
//Fill in The Static Driver List
Stt_driverList[i] = driverList[i];
}
它的工作,謝謝很多。 –