Keith,
Far be it for me to provide an alternative to the industrious Oleg,
[Excellent contributions both here and on his weblog]
If you're not too concerned about performance and are trying to build a
hierarchical XML representation of some obvious SQL relationships it may be
easier to build 5 data adaptors, create the relationships and then extract
the XML.
By test code looks like...
Database connection string in strConn
Streamwriter in strmOutput
SqlConnection conn = new SqlConnection(s trConn);
SqlDataAdapter dtaHolder = new SqlDataAdapter( "Select * from LPS_HOLDER
where FIRST_NAME like '%cook%'",conn) ;
SqlDataAdapter dtaLocation = new SqlDataAdapter( "Select * from
LPS_LOCATION",c onn);
conn.Open();
DataSet dsHoldLoc = new DataSet("Holder Location");
dtaHolder.Fill( dsHoldLoc,"Hold ers");
dtaLocation.Fil l(dsHoldLoc, "Locations" );
conn.Close();
DataRelation drHoldLoc = dsHoldLoc.Relat ions.Add("HoldL ocs",
dsHoldLoc.Table s["Locations"].Columns["INITIAL_LOCATI ON_ID"],
dsHoldLoc.Table s["Holders"].Columns["INITIAL_LOCATI ON_ID"],false);
drHoldLoc.Neste d = true;
dsHoldLoc.Write Xml(strmOutput) ;
strmOutput.Flus h();
strmOutput.Clos e();
Stephen
"Keith Chadwick" <kc*******@leew ardsystems.com> wrote in message
news:ei******** ******@TK2MSFTN GP09.phx.gbl...
My problem is this. I have to create several xmlReader objects each
retrieving 'for xml' formatted sql server data. I then need to peice them
together into a single document and place them into a single XPathDocument
which is then transformed throughout the web site with different
XslTransformati ons. I realize that the Xpathdocument will accept a
XmlReader as an object but I have 5 of them so how to 'best' combine. The
resulting XpathDocument is placed into the Cache and is only updated twice
a day.
Cheers
Keith
Note: I do note have access to the SQLXML objects on the production ISP
site otherwise I would use them!