开发者

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:

  1. Delete from mytable where transID = 3
  2. Update mytable set name = ‘mahendra’ where transID=2
  3. 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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜