using DataSet to transport data as XML

  • Thread starter Thread starter José Pérez Hernández
  • Start date Start date
J

José Pérez Hernández

Hi,

I have two exacts databases, but phisically distant and without direct
connection. I want data be transported from one place to another. The
process that i'm doing to achieve that is loading a DataSet from source
database, writting schema to an XSD file, writting data to an XML file
sending them by any mean (email as first attempt) and in the other point,
receiving the XMLs, loading DataSet and update to a destination database.

I have done almost everything , but i have troubles with the last part of
the process. How i can say that the changes in the DataSet must be updated
in the destination database?

Will i have troubles with the relations of the tables ?

Regards, José.
 
The whole issue resolves around rowstate if you are firing an update command
on the other side. If the rowstate of each row is added, it will use the
Insert command. If the rowstate is modified, it will use the Update
command. When you fill the first dataset, set AcceptChangesDuringFill to
false. Also, make sure you use the diffgram option when writing to XML.
This will cause the rowstate of everything in the source dataset to be Added
insteda of unchanged. Diffgram preserves rowstate so when you do your
readxmol on the other side, the rowstate will be added... then all you need
to do is call your dataAdapter.Update with a valid Insert Command.

HTH,

Bill
 
Back
Top