creating an xsd through xsd designer - xml format

  • Thread starter Thread starter Lea mood
  • Start date Start date
L

Lea mood

Hi all,
I need some help:
I have a DataSet object created by the .NET "xsd designer". The DataSet
is being filled from a Stored Procedure which returns the results of a
few select statements.

I have no problem filling the DataSet, but when I use the method
GetXml() I get an XML string that is not in the format I wanted.

I get somthing like this:

<Table>
<Field_1>1</Field_1>
<Field_2>eng</Field_2>
</Table>
<Table1>
<Field_1>1</Field_1>
<Field_2>eng</Field_2>
</Table1>

When actually I wanted something like this:

<Table>
<Field_1>1</Field_1>
<Field_2>eng</Field_2>
<Table1>
<Field_1>1</Field_1>
<Field_2>eng</Field_2>
</Table1>
</Table>

I created the xsd by dragging & droping tables in the designer. I put
"Table1" into "Table" when I did that, but nothing happened.

Is there a way to force a selected format on the XML I generate from the
data in such a DataSet, or do I have to create the whole thing by code?

Thanks!

Lea
 
Have you verifed the count on tables in dataset? One possible problem you
may have is that there is no mapping, so another table is being filled.
Check that tables.Count =1 as you expect.

As far as how process data in XML to a format you want, there is limited
resources available to do this. You will probably have to use Xslt to get
this in an format that is appropriate to you.
 
Back
Top