Well, you don't have much of a choice but to process all deletes first, then go through and add the rows. The TableAdapter goes through the rows, one-by-one and processes them according to their state. If, by chance, you've added a row to a dataset, then you've pretty much duplicated a key because the adapter hasn't gotten to the deleted row yet and executed the SQL for it. Normally, people don't reuse key values.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008