boPacketLists oPL = new boPacketLists(); foreach(DataRow oRow in this.GetCurrentDataSet().Tables[0].Rows) { oPL.NewRow(); oPL.DataRow["MDCMainId"] = oRow["id"]; oPL.DataRow["PacketId"] = iPacketId; } oPL.SaveDataSet();The rows are all added successfully to the dataset, but when SaveDataSet is called, it using the same value for ID, and therefore the following error is generated