Merge and Get Changes returns nothing

  • Thread starter Thread starter Joseph Byrns
  • Start date Start date
J

Joseph Byrns

I have a simple case of two datasets each containing a table with the same
schema. When I merge the two datasets, the empty tables in daataset1 get
filled with the rows from dataset2, all fine so far. When I try and get the
changes of the tables in dataset1 no changes are returned. Any ideas?

''merge the server table with the local table
ds_Server.Merge(ds_Local)
ds_Server.Table(0-x) all have rows now,
but ds_Server.Table(0-x).GetChanges returns nothing.
 
Joseph,

Because you merge complete rows, not items.

The datarowstates stay the same, it is not a kind of selective merge as you
have maybe the idea about..

It merges all, where the rows with the same key are replaced and the ones
with not a same key in the called table are added to the caller.

I hope this helps,

Cor
 
So what is the cure, do I have to go through each row and change the
rowstate to modified and inserted as appropriate?
 
Joseph,

Normally they have a changed rowstate in advance, however why that is not,
is something I cannot see from this message thread. Do you use by instance
somewhere acceptchanges in advance?

Cor
 
No, I get data from a local database (based on a primary key GUID) then I
get data from a server database (based on the same GUID), then I merge the
local dataset to the server dataset, none of the rows that get inserted have
any rowstate other than unmodified.
 
Joseph,
No, I get data from a local database (based on a primary key GUID) then I
get data from a server database (based on the same GUID), then I merge the
local dataset to the server dataset, none of the rows that get inserted
have any rowstate other than unmodified.
Than the merged rows have as well a rowchange unmodified. However, this will
probably help you when you use it on the local(I assume this) fill.

http://msdn.microsoft.com/library/d...aadapterclassacceptchangesduringfilltopic.asp

I hope this helps,

Cor
 
Excellent, I set AcceptChangesDuringFill to false for the local database and
everything now seems to work fine.

Thanks.
 
Back
Top