Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have 4 list views containing certain data that can be edited and delete by the user. The question is once all the editing is done and they are happy how do I commit it to the db. I know how you INSERT to db's etc just not sure how to do a group of data from a listview.]

Thanks in advance
Posted
Updated 24-Aug-11 22:12pm
v2

1 solution

well there is two things.
first: if there is data in the db should it be overwritten? Better to remove from db and insert each item from listview to db.
so:
first delete in DB
and then for each listview object:
C#
foreach(var item in ListView1.Items)
{
    // set the values to sqlparameters
    // insert in db

}
 
Share this answer
 
Comments
DanHodgson88 25-Aug-11 4:18am    
Spot on mate, thanks for that :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900