Home All Groups Group Topic Archive Search About

Dataset xsd validation and using .Getxml

Author
17 Nov 2004 9:07 AM
Meral via .NET 247
I'm having problems getting the XML in the format I require.

I want my XML to basically look as:

<DataRequester>
   <Instruments>
      <Instrument>
         <InstrumentDetails>
            <InstrumentId>123</InstrumentId>
            <UniqueId>abc</UniqueId>
         </InstrumentDetails>
      </Instrument>
      <Instrument>
         <InstrumentDetails>
            <InstrumentId>456</InstrumentId>
            <UniqueId>def</UniqueId>
         </InstrumentDetails>
      </Instrument>
      ...
    <Instruments>
</DataRequester>

I'm using a DATASET and XSD files. I am able the generate the DATASET schema based on the XSD file okay. I manually assign the values in <InstrumentDetails> in my VB.NET code. However, the nodes <Instruments> and <Instrument> don't appear in the XML when I use Dataset.Getxml

My XML appears as:

<DataRequester>
   <InstrumentDetails>
      <InstrumentId>123</InstrumentId>
      <UniqueId>abc</UniqueId>
    </InstrumentDetails>
    <InstrumentDetails>
      <InstrumentId>456</InstrumentId>
      <UniqueId>def</UniqueId>
    </InstrumentDetails>
</DataRequester>

Can someone please me with how I should fill in the DATASET.

Thanks

From: Meral

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>QKl3emii0EmLveIbV5J2xg==</Id>

AddThis Social Bookmark Button