给定一个 XSD 文件,如下代码会在返回的 DataSet 的两个 DataTable 中生成一个额外的(和不需要的)列。
ds.ReadXmlSchema(s);
两个数据表都有一个 Order_Id 列;其他列与 XSD 完全匹配。
有没有其他人见过这个?
XSD 文件如下:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Order">
<xs:complexType>
<xs:sequence>
<xs:element name="Item" minOccurs="0" maxOccurs="unbounded">
<xs:complexType msdata:AutoIncrement="false">
<xs:attribute name="itemId" type="xs:unsignedInt" />
<xs:attribute name="stockCode" type="xs:string" />
<xs:attribute name="stockCodeType" type="xs:string" />
<xs:attribute name="Quantity" type="xs:unsignedLong" />
<xs:attribute name="ProductIdX" type="xs:unsignedInt" />
<xs:attribute name="legalEntity" type="xs:string" />
<xs:attribute name="countryOfIssue" type="xs:string" />
<xs:attribute name="branchSystem" type="xs:string" />
<xs:attribute name="accountId" type="xs:string" />
<xs:attribute name="settlementDate" type="xs:string" />
<xs:attribute name="tradeDate" type="xs:string" />
<xs:attribute name="partyCode" type="xs:string" />
<xs:attribute name="userId" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="OrderId" type="xs:unsignedInt" />
<xs:attribute name="StrategyId" type="xs:string" />
<xs:attribute name="ActivityId" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:schema>