query to deducting my stock value in listview1

Questions ArchiveCategory: Programmingquery to deducting my stock value in listview1
soma yukihira asked 3 months ago

what query i will do if i want to reduce my stock item in database.. i want if i transfered stock value its deduct to my stock in listview1
\"\"

1 Answers
Hassan Aboul Hassan answered 3 months ago

Hi friend.
Simply you can use an update query:
update TableName set  FieldName =  FieldName – 1 where  IDField = ID
 
Then simply update your listview or refresh Items in it, it’s better to update only the selected row something like this:
SelectedListviewItem.SubItems[4].Text = (int.parse(SelectedListviewItem.SubItems[4].Text) -1).ToString();