How to flag dataset rows as new

  • Thread starter Thread starter cj
  • Start date Start date
C

cj

I am copying rows from a database/table on Server_A to a database/table
on Server_B. I use Server_A_DataAdapter.fill to load the rows into a
dataset. Then Server_B_DataAdapter.update to put the rows into the
database/table on Server_B. I then notice that the rows are not being
put on Server_B via the insert command of Server_B_DataAdapter because
the rows are not new to the dataset.

How can I flag the rows in the dataset as new?
Or is there a better way to accomplish this task?

Thanks
 
CJ,

By setting the acceptchangesafterfill property from the dataadapter to false

I hope this helps,

Cor
 
I don't see acceptchangesafterfill in the help.
I see:
DataRow.AcceptChanges Method [Visual Basic]
Commits all the changes made to this row since the last time
AcceptChanges was called.

DataAdapter.AcceptChangesDuringFill Property [Visual Basic]
Gets or sets a value indicating whether AcceptChanges is called on a
DataRow after it is added to the DataTable during any of the Fill
operations.

How would I use acceptchanges.... in the below code.
MyOdbcAdapter.Fill(MyDs, "recent_calls")
SqlDataAdapter1.Update(MyDs, "recent_calls")
 
They don't have any examples of how this is used but this seems to work.
Thanks for the help.

MyOdbcAdapter.AcceptChangesDuringFill = False
MyOdbcAdapter.Fill(MyDs, "recent_calls")
SqlDataAdapter1.Update(MyDs, "recent_calls")
 
Back
Top