How do I create this XML document from ms sql server 2005

rhaazy's Avatar, Join Date: Jul 2007
Go4Expert Member
I need to create this XML document:

Code:
  <?xml version="1.0" encoding="utf-8" ?> 
- <ScanConfiguration> 
- <Configurations> 
  <Configuration ID="4" PID="1" Name="Basic Overview" 
UOM="IsScanned">TRUE</Configuration> 
  <Configuration ID="5" PID="1" Name="Drives" UOM="IsScanned">FALSE</ 
Configuration> 
  <Configuration ID="6" PID="1" Name="ErrorLog" UOM="IsScanned">FALSE</ 
Configuration> 
  <Configuration ID="7" PID="1" Name="MSI Installed" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="8" PID="1" Name="Normal Installed" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="9" PID="1" Name="Active Setup" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="10" PID="1" Name="Software Usage" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="11" PID="1" Name="Memory" UOM="IsScanned">FALSE</ 
Configuration> 
  <Configuration ID="12" PID="1" Name="OS" UOM="IsScanned">FALSE</ 
Configuration> 
  <Configuration ID="13" PID="1" Name="PhysicalDisks" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="14" PID="1" Name="Basic Processor Info" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="15" PID="1" Name="Detailed Return Info" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="16" PID="1" Name="Processor Cache Info" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="17" PID="1" Name="Running Programs" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="18" PID="1" Name="Security Info" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="19" PID="1" Name="Port Information" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="20" PID="1" Name="Security Settings" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="21" PID="1" Name="System Restore" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="22" PID="1" Name="Windows Firewall" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="23" PID="1" Name="Windows Update" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="24" PID="1" Name="Driver Services" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="25" PID="1" Name="Process Services" 
UOM="IsScanned">FALSE</Configuration> 
  <Configuration ID="26" PID="1" Name="StartUp" UOM="IsScanned">FALSE</ 
Configuration> 
  <Configuration ID="27" PID="1" Name="TCPIP" UOM="IsScanned">FALSE</ 
Configuration> 
  <Configuration ID="28" PID="1" Name="InternetCache" 
UOM="IsScanned">FALSE</Configuration> 
  </Configurations> 
  </ScanConfiguration>
the columns in the database are from tblScanProfileDetail:
Section(ID), ScanProfileHeaderID(PID), Type(Name), and Value(TRUE/FALSE)

Last edited by shabbir; 7Aug2007 at 23:08.. Reason: Code block
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Just paste the content into a file and save it as somename.xml
rhaazy's Avatar, Join Date: Jul 2007
Go4Expert Member
Let me rephrase the question, i am having trouble serializing the dataset into the xml document. I have tried using FORXML EXPLICIT and tried using column mapping properties built into .NET, however I am unable to get the desired output.
rhaazy's Avatar, Join Date: Jul 2007
Go4Expert Member
I was able to create a serialization class to do this, thanks anyway.