Weird Duplicate Change Event Error from XSD.exe

  • Thread starter Thread starter Mark Olbert
  • Start date Start date
M

Mark Olbert

Can someone explain to me why the following simple dataset:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="meter_params">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="meter">
<xs:complexType>
<xs:attribute name="fillColor" type="xs:string" use="required" />
<xs:attribute name="centerOffset" type="xs:int" use="required" />
<xs:attribute name="amount" type="xs:decimal" use="required" />
<xs:attribute name="schoolYear" type="xs:int" use="required" />
<xs:attribute name="changeDate" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
<xs:element maxOccurs="unbounded" name="steps">
<xs:complexType>
<xs:attribute name="amount" type="xs:int" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

when generated by:

xsd.exe /d meter_params.xsd

and then compiled in a website throws a whole bunch of "The type 'meter_params' already contains a definition for..." errors?

- Mark
 
Are you generating the typed dataset, and bringing the dataset into the
web application, while the schema document is in the web application
already and is marked to "generate dataset"? Jump into the xsd
document in visual studio and while in design mode right click an area
(not an element or anything like that) and un-check "Generate Dataset".


HTH,
Darren Kopp
http://blog.secudocs.com/
 
Back
Top