I'm trying to serialize a *List* of objects, where each object contains a DataTable. I'm just using the XmlSerializer, out of the box. The result I'm getting is that each object (in the resulting XML) is defining a custom type for the DataTable, as listed at the bottom. My question is, how can I get the generated XML to define this complex type *once*, and use it for every object in my result?
Oh, and I'm using C#, but examples in VB would be just fine.
Thanks!
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
microsoft-
com:xml-ms
data">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:MainDataTable="Prop
ertiesA" msdata:UseCurrentLocale="t
rue">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="PropertiesA">
<xs:complexType>
<xs:sequence>
<xs:element name="Value" type="xs:string" minOccurs="0" />
<xs:element name="ColumnName" type="xs:string" minOccurs="0" />
<xs:element name="DataType" type="xs:string" minOccurs="0" />
<xs:element name="FrameworkDataType" type="xs:string" minOccurs="0" />
<xs:element name="IsIdentity" type="xs:boolean" minOccurs="0" />
<xs:element name="DbDataType" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
Start Free Trial