Hi and thanks for your answer!
I need to copy all rows, not just added rows from the original dataset. But
in the new dataset all copied rows must have status as added so that they
are written to the database as new records. Perhaps I haven't managed to
explain what I need to accomplish very well, hope this helps. Below is an
example:
Original DataSet with one table with one row:
dsOrig
->tblTest
->rows[0]
-> colID = 63 (autoinc column)
-> colName = 'Test'
will be copied to a new dataset like this:
dsNew
->tblTest
->rows[0]
-> colID = -1 (autoinc column, column is set to start new
records at -1 and increment new rows by -1, hence the first row will be -1)
-> colName = 'Test'
Well, as far as I can tell I need to go through all the tables and all the
rows in the original dataset and copy the data over row by row and set
parentrow to the correct parentrow to maintain referential integrity.
Maybe another solution is to use DataSet.Copy and then modify the values of
the primary keys (autoinc) columns to new values and set each rows rowstate
to added? Is this even possible?
What do you guys think?
Sincerely,
Trygve
"Ritesh Jain via DotNetMonster.com" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Hi,
>
> Try with this........
>
>
> Dim dsNew As DataSet
> dsNew = oldDataSet.GetChanges(DataRowState.Added)
>
> I hope this will help u............
>
> Regards,
> Ritesh
>
> --
> Message posted via http://www.dotnetmonster.com