It's not much. Here:
1. Dim changedData As DataSet = data.GetChanges() 2. changedData = WebServiceProxy.Update(changedData) 3. data.Merge(changedData)
Line 1 get changes, line 2 call a web service that does the update using common data adapters and line 3 merges the returned dataset. Web Service call does not accept dataset by reference so it returns it as a return value also. Autoinrement values are updated using an update command with this format:
"INSERT INTO [TABLE] (........) VALUES (.............); SELECT [PKID] FROM [TABLE] WHERE [pkID]=SCOPE_IDENTITY()"
Original dataset in line 1 has one added row. And finally dataset after line 3 has on added row and on unchanged row, which is the one inserted to the database.
Thanks for helping me out!
Dimitris Papadimitriou |