Hi to all,
I have always had this problem where: if I have a datagrid with records like

RecID Name
2 Tom
5 Rich
6 Harry

To Save I will loop through the rows using the sql
IF NOT EXISTS(SELECT * FROM myTable WHERE RecID= dgv.rows(i).cells(0).value say)
BEGIN INSERT the row.(the use INSERT COMMAND)

At the end of the loop I have to delete all records whose RecID are not in the Datagrid.
My Problem is:
How do I create a kind of list of datagrid RecIDs and do something like
DELETE FROM myTable WHERE RecID NOT IN (2,5,6)

Thanks in advance