When you create the DataAdapter set the AcceptChangesDuringFill property to
false
This will force all the rows inserted into the dataset to be marked as new
rows therefore allowing you to call the DataAdapters update method to submit
the rows to the database.
Good Luck
Brian Parlier
"HectorG" <(E-Mail Removed)> wrote in message
news:6284EB4C-B6FC-4F1B-92AD-(E-Mail Removed)...
> Hi,
>
> I've an webservice that returns a dataset. I want to insert the content of
one of the tables of the dataset into a SQL table in my SQL Server. The
problem is that i don't want to make a loop to insert record by record, and
also, i want to apply the current insert/update method to update the data in
the database.
>
> The scenario is something like a replication: recover data from an online
database, wich comes into a dataset, and then update this data in my
database (tables), considering that some of these records should exists on
the local copy, so they must be updated, and some others shouldn't, so must
be inserted.
>
> I've tried using a dataadapter and commandbuilder, and updating the
dataadapter with the dataset that returns the webservice, but it doesn't
work. Can you help me, maybe with some code, or explanation? Thanks!
|