copy row of table in ds to same table
The table in the data set represents a contract that can be amended at a later date. If amended, I need another row in the table with a different effective date. The user will then change the price, voulme, location or whatever changed to cause the amendment. I need both versions of the contract in the table since schedulers work with the data in the future months and accounting works with the data in the prior month. ( No one works with the data in the current month.)
I have tried the following:
Dim nr as datarow = ds.tables(0).rows(0)
... change the key field effective date
ds.tables(0).rows.add(nr)
This produces an error stating the row already exists in the table, apparently because the row number is the same. The key field was changed.
Could you explain more about the copy and copyto methods? The copyto method copies the row to an array (I think), but how do you copy the array back to a row?
Thanks for the responses.