Hi all,
I want to create an xml file that will be based on the same structure as my sql database which consists of 4 tables. Here are the 4 tables and the columns within each table:
Code:
BrochureHeader
Columns
BrochureID
BrochureName
BrochureMerchant
Columns
BrochureID
MerchantRow
BrochureSpot
Columns
BrochureID
MerchantRow
SpotNum
BrochureLine
Columns
BrochureID
MerchantID
SpotNum
LineNum
CopyText
I want my XML File to appear as follows:
<Level1>
<BrochureName>ABC School</BrochureName>
<Level2>
<MerchantRow>1</MerchantRow>
<Level3>
<SpotNum>1</SpotNum>
<Level4>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
</Level4>
</Level3>
<Level3>
<SpotNum>2</SpotNum>
<Level4>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
</Level4>
</Level3>
</Level2>
<Level2>
<MerchantRow>2</MerchantRow>
<Level3>
<SpotNum>1</SpotNum>
<Level4>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
</Level4>
</Level3>
<Level3>
<SpotNum>2</SpotNum>
<Level4>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
<CopyText>Some Text</CopyText>
</Level4>
</Level3>
</Level2>
</Level1>
I am having a terrible time getting this to work. I hate to post my code at this point because it doesn't work. I creating a dataset for each of my tables and I have messed around with the datarelation class but I have not had much luck. DOes anyone know of a web site that creates an XML file with similar hiearchy or does anyone have some code they can share?
Thanks,
Bob