A
Alejandro Calbazana
Hello,
I am investigating how to incorporate xml into a dataset while
preserving parent/child relationships. I understand that I can read
in an xsd to define the structure of the data and relationships. What
I am less clean about is if it is possible to read in an xml document
that conforms to the xsd AND have parent child relationships resolved
for me as my records are inserted using ReadXml().
I ask this because I have a set of tables which contain autoincrement
fields. When the parent gets a new identity, it should be given to
the children records as they are inserted.
SQLXml Bulk Load seems to do this for me after I cobble together an
xsd to make this happen. However, I have additional processing that I
need to do, so bulk loading will not help me here.
I am considering a dataset but I'd like to confirm or eliminate the
possibility of using the relationships, as defined by the schema, to
propogate the keys as my child records are inserted using ReadXml().
I have confirmed that my xsd creates the proper relationships for me.
I have also added records by hand using the SetParentRow(parentRow)
method. I get back the results that I expect, but I am wondering if I
can get the same result by using ReadXml().
Any help is appreciated.
Thanks,
Alejandro
I am investigating how to incorporate xml into a dataset while
preserving parent/child relationships. I understand that I can read
in an xsd to define the structure of the data and relationships. What
I am less clean about is if it is possible to read in an xml document
that conforms to the xsd AND have parent child relationships resolved
for me as my records are inserted using ReadXml().
I ask this because I have a set of tables which contain autoincrement
fields. When the parent gets a new identity, it should be given to
the children records as they are inserted.
SQLXml Bulk Load seems to do this for me after I cobble together an
xsd to make this happen. However, I have additional processing that I
need to do, so bulk loading will not help me here.
I am considering a dataset but I'd like to confirm or eliminate the
possibility of using the relationships, as defined by the schema, to
propogate the keys as my child records are inserted using ReadXml().
I have confirmed that my xsd creates the proper relationships for me.
I have also added records by hand using the SetParentRow(parentRow)
method. I get back the results that I expect, but I am wondering if I
can get the same result by using ReadXml().
Any help is appreciated.
Thanks,
Alejandro