Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. foreach (DataRow item in table.Rows)
  2. {
  3.  
  4. pcdatasource.PurchaseID = pmdatasource.PurchaseID;
  5. pcdatasource.CategoryID = Convert.ToInt32(item["Category ID"]);
  6. pcdatasource.PorductID = Convert.ToInt32(item["Product ID"]);
  7. pcdatasource.SupplierID = supplierid;
  8. pcdatasource.PurchasePrice = item["Purchase Price"].ToString();
  9. pcdatasource.SalePrice = item["Sale Price"].ToString();
  10. pcdatasource.Quantity = item["Quantity"].ToString();
  11. pcdatasource.TotalPrice = item["Amount"].ToString();
  12. dbcontext.Purchase_Child_tbl.AddObject(pcdatasource);
  13. dbcontext.SaveChanges();
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement