try
{
while (((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2 != null)
{
PackedOrder po = new PackedOrder();
rowIndex = 1 + index;
string ordernum = ((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2.ToString();
po.OrderNum = ordernum;
po.ShipperID = packID;
ie.Add(po);
index++;
}
db.PackedOrders.InsertAllOnSubmit(ie);
db.SubmitChanges();
}
|