private void Items_Click(object sender, EventArgs e)
{
AllItemData AllItemDatas = this.GetItemData();
List DataIns = AllItemDatas.ItemData;
dalDataContext context = new dalDataContext();
itemTable i = new itemTable();
foreach (DataIn d in DataIns)
{
try
{
i.item_no = d.item_no;
context.itemTables.InsertOnSubmit(i);
}
catch (Exception ex)
{
//TODO: do something with exeption
}
}
try
{
context.SubmitChanges();
}
catch (Exception ex)
{
//TODO: do something with exception
}
}
|