Fantastic. The two solutions work fine. But if I have understood, i have to take mc73's solution, more complexe but more secure.
I don't understand the possible problem with mahares's solution.
Thank you both.
Let me explain the problem to both of you. Suppose we have 3 items, with ids 1,2,3, ok? Then, let's delete item 2. Mahares' solution will work fine. Then, when we load again the table we will have 2 items, with ids 1 and 3. The position in the list, will be 1,2. So, if we try to delete item 2 (in the list), we will not find item with id 3, if we choose its position.
EDIT: Oops, nope! Now that I see Mahares' code better, and since you'll be always setting a clone of the whole table to the list, it will also work well, without a problem. Anyway, if you have a really large database, then quering the whole table while you're just searching for a simple record, would take a bit more time, so still I think that you should query by ID as I wrote earlier.