i have a certain datatable in a gridview. Users can edit or delete a row. I'm using RowCommand for this.
the data is written to the database when the users confirms to save the current shown gridview to the database.
before, i deleted all the lines from the database (related to a certain productID) and then add all rows from the gridview.
i want to replace the procedure by using an UPDATE query instead of a DELETE and then INSERT query.
Updating the rows using UPDATE is no problem, if the users doesn't delete a line from the gridview. But if a user deleted a line from the gridview, then i have problem. i can update the ones that still exist, but i can't flush the reconds in the SQL database for the records that were deleted from the gridview.
my solution is to move the DELETE query to the rowcommand ..
other solution is to flag the rows that needs to be deleted and don't show the flagged lines in the gridview.
anyone has a different solution for this?