Typed dataset questions: Translation into another typed dataset

G

Guest

Trying to get some feedback.

Here's the scenerio.

We are processing XML data which we generated a typed dataset to represent
the XML document being processed. After procesing is complete we would like
to add/update/delete the data in multiple databases. Here lies the
disconnect. The XML representation is seperated from the physical model(s)
in the database there for the typed datasets are drastically different. What
is the best way to transform a typed dataset into another typed dataset
effeciently. Please do not suggest a serializing the object into XML and
applying a stylesheet. What is the most effecient method to map the objects?

Thanks
-Joe
 
D

David Browne

BeanTownBizTalkGuru said:
Trying to get some feedback.

Here's the scenerio.

We are processing XML data which we generated a typed dataset to represent
the XML document being processed. After procesing is complete we would
like
to add/update/delete the data in multiple databases. Here lies the
disconnect. The XML representation is seperated from the physical
model(s)
in the database there for the typed datasets are drastically different.
What
is the best way to transform a typed dataset into another typed dataset
effeciently. Please do not suggest a serializing the object into XML and
applying a stylesheet. What is the most effecient method to map the
objects?


The most efficient method is to write code to do it. Add new rows to the
target dataset based on the data in the source dataset.

Something like:

TypedDS1 ds1 = ...;
TypedDS2 ds2 = new TypedDS2;

foreach (TypedDS1.Table1Row r in ds1.Table1.Rows)
{
TypedDS2.TableXRow dr = ds2.TableX.NewTableXRow();
dr.A = r.B;
...
}

David
 
G

Guest

Thanks Dave, that is what I expected. I am tossing around the idea of
writing a custom serialization class for the source XML document to the typed
dataset of each type. Not really sure what the final decision will be
though. THanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top