Dataset -> Xml -> Dataset , how to get it to work?

  • Thread starter Thread starter Karl
  • Start date Start date
K

Karl

Hi

I have a dataset with one simple table. I use writeXml method to get the
data as xml, then export it to another app, change the data, and then I get
the Xml back. The problem is to merge/update the Xml data back to a normal
dataset, and then back to the database.

The Xml I get in return from the other app is correct. When I try
dataSet.merge, the records never enters the dataset, and I get no exception
to help me pinpointing the problem.

Anyone knows how to accoplish this?

regards

Karl
 
Try using CopyTo on the table(s) and see if you can pull them into the
DataSet you are trying to update with.

You also have to make sure you are using the same DataAdapter you use to
pull the data originally.

Another thing to check is the update (and possibly insert) command.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Karl,
The default behavior of the Merge function is to Accept Changes on the
target dataset. If you then try to update the database with a call to
GetChanges on the target dataset, there will be no changes.
If this is the case, try using the following version of Merge:

DS1.Merge(DS2,True)

The True tells Merge to preserve changes.

Hope this helps,
Dave
 
Back
Top