Update Sql Table By Listview Items
My listview has three columns and rows as below:
Trans ID Name Amount
1 mah开发者_StackOverflow中文版esh 1000
2 mahendra 2000
3 kirti 3000
Is there possible to update/insert/delete on sql table like below:
- Delete from mytable where transID = 3
- Update mytable set name = ‘mahendra’ where transID=2
- Insert into mytable(transID,name,amount)values(@transID,@name,@amount)
Is it possible The above three sql transact statement with Listview?.
I am Looking For Code Example Here.
If you mean is update the DB Table by your listview ... I think it is like ↓
1) delete from yourtable where transid in (all ids in your listview);
2) foreach(var item in listview.Items) Insert into yourtable(transID,name,amount)values(@transID,@name,@amount)
精彩评论