How to get the element names using a dataset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I need to get the elementnames and the no of elements froman XSD. I used
readXMLSchema method to read the schema, but i am not able to get the element
names. here is my schema...

<?xml version="1.0" ?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<element name="Root">
<complexType>
<sequence>
<element name="Row" maxOccurs="unbounded">
<complexType>
<sequence>
<element name="PersonID" type="xs:int" minOccurs="1" />
<element name="FirstName" type="xs:string" minOccurs="1" />
<element name="LastName" type="xs:string" minOccurs="1" />
<element name="VariableName" type="xs:string" minOccurs="1" />
<element name="Amount" type="xs:decimal" minOccurs="1" />
<element name="TaxPaid" type="xs:decimal" minOccurs="1" />
<element name="BenefitDeduction" type="xs:decimal" minOccurs="1" />
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>

If you have any samples, please send it across to me.
 
Hi,

When you load XSD into DataSet, then element names will be column names in a
DataTable(s). Number of the elements will be the same as number of the
columns. Is it what you need?
 
Back
Top