The current XSD is :
<xs:element name="Country">
<xs:complexType>
<xs:sequence>
<xs:element name="code" type="xs:string" />
<xs:element name="name" type="xs:string" />
<xs:element name="diallingcode" type="xs:int" />
<xs:element name="displayOrder" type="xs:nonNegativeInteger" />
</xs:sequence>
</xs:complexType>
<xs:key name="countryKey1">
<xs:selector xpath="." />
<xs:field xpath="mstns:code" />
</xs:key>
</xs:element>
And the generated class is:
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class CountryDataTable : global::System.Data.TypedTableBase<CountryRow> {
As soon as I modified the XSD, adding a new field. The generated class changes to:
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class CountryDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable {
This last code breaks some Linq queries that are using the dataset.
Does anyone know what the problem could be?
The generation of code is not behaving properly yet (when updating an existing XSD). The way I've found to sort out the problem is deleting Dataset.Designer.cs file (or just renaming it) every time I want to make a change in the XSD. When the file is being generated from the scratch, the code is generated properly.