on the client side, use AutoIncrementSeed = -1 and AutoIncrementStep = -1,delete all records all ID < 0,and merge the returned records
------------------------------------
这个办法试下先...
how complicated is your dataset? does it have multiple tables and parent-child relationship?
if it is not very complicated, on the client side, use AutoIncrementSeed = -1 and AutoIncrementStep = -1, and only send the Changed DataSet to the webserive. On the server side, use a similar method to what was outlined in the above link to retrieve the new IDs. Then on the client side, delete all records all ID < 0, and merge the returned records, then call AcceptChanges() on the dataset
otherwise, you have to requery the database and get all the data again
how are you updating the database? dataset or parameterized query? you can always add a "SELECT @@IDENITY as ID" or "SELECT SCOPE_IDENTITY() AS ID" to retrieve the id