Results 1 to 3 of 3

Thread: [RESOLVED] dataset writexml question

  1. #1

    Thread Starter
    Hyperactive Member jasonwucinski's Avatar
    Join Date
    Mar 2010
    Location
    Pittsburgh
    Posts
    452

    Resolved [RESOLVED] dataset writexml question

    hello,
    I have a question about using writeXml. When I use this method, it writes to the specified xml file like this:
    Code:
    <safety>
       <Incident>
         <Name>Jason</Name>   
         <AGE>23</AGE> 
       </Incident>
    
       <Incident>
         <Name>Frank</Name> 
         <AGE>25</AGE> 
       </Incident>
    </safety>
    but, I would like to add these nodes to a parent node, ie:
    Code:
    <safety>
        <SomeNode>
           <Incident>
             <Name>Jason</Name>   
             <AGE>23</AGE> 
           </Incident>
    
          <Incident>
            <Name>Frank</Name> 
            <AGE>25</AGE> 
          </Incident>
      </someNode>
    </safety>
    I am creating the xml by first creating a dataset (connects to an SQL db and runs a query, filling the dataset) and using ds.WriteXML(myPath)

    Any suggestions would be great. Thanks
    jason
    if i was able to help, rate my post!

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    Re: dataset writexml question

    You have full control over XML using the various XML classes. The problem would be that once you tinker with the XML, it is likely that you won't be getting your dataset back via ReadXML, because it will no longer be recognizeably a dataset. Is that an issue?
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Hyperactive Member jasonwucinski's Avatar
    Join Date
    Mar 2010
    Location
    Pittsburgh
    Posts
    452

    Re: dataset writexml question

    yeah, it might be. after talking with co-workers, we decided it doesnt need to be in a parent node. thanks for the help, though
    if i was able to help, rate my post!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width