i av tried this but the result is not reflecting on my database:
int ge = context.GeneralStockTBs.Where(aa => aa.Goods_Type_ID.Equals(ide)).Select(a => a.Total_each_quantity).Single();
int compute = ge - quanty;
stockk.General_Stock_ID = stockk.General_Stock_ID;
stockk.Goods_Type_ID = stockk.Goods_Type_ID;
stockk.GoodsnameGeneral = stockk.GoodsnameGeneral;
stockk.st_id = stockk.st_id;
stockk.Stocking_Date = stockk.Stocking_Date;
stockk.Total_amount_quantity = compute;
//stockk.Total_each_quantity = stockk.Total_each_quantity;
try
{
context.SubmitChanges();
MessageBox.Show("Update");
}
catch
{
MessageBox.Show("cannot update");
}
Olubjay