if you retrive your data from database and store it in dataset
---- get the selectedID, note that the following code only change the data
in your dataset rather than database
form each row in dataset.table("table").rows
if row.item("id") = selectedID
row.delete
end if
next