在VS2010中更改数据集XSD会生成从DataTable继承的代码,而不是TypedTableBase< Type>
目前的XSD是:
<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>
生成的类是:
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class CountryDataTable : global::System.Data.TypedTableBase<CountryRow> {
一旦我修改了XSD,就添加一个新字段。生成的类更改为:
[global::System.Serializable()]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class CountryDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable {
最后一个代码打破了使用数据集的一些Linq查询。
有谁知道是什么问题?
没有找到相关结果
已邀请:
1 个回复
珊畴炮贩号