I'm trying to find a good code sample to update a database entry in my listview control. I suppose I would need to extract the ID from somewhere (some label control?). I am using LINQtoSQL to talk with the database.
protected void lvTargets_ItemUpdating(object sender, ListViewUpdateEventArgs e)
{
InventoryDataContext inventory = new InventoryDataContext();
//Target target = from target in inventory.Targets
// where target.ID == lvTargets.Items[e.ItemIndex].FindControl("ID")
// *** Not sure how to go about this ^^^
//inventory.Targets.InsertOnSubmit(target);
//inventory.SubmitChanges();
lvTargets.EditIndex = -1;
BindInventory();
}