I using an XSD file (posted below) and I'm letting the VS .NET generate a
DataSet object for it using the MSDataSetGenerator tool.
Using the generated DataSet ( EvsDB ) I try to add to the Defect table a
PictureDump table, but I only succeed to add the table but it does connect to
the Defect table.
The code I'm using is:
EvsDB ds = new EvsDB();
ds.ReadXmlSchema("EvsDB.xsd");
EvsDB.DefectRow clRow = ds.Defect.NewDefectRow();
clRow.ID = 111L;
clRow.FrameID = 51;
.. . .
ds.Defect.AddDefectRow(clRow);
EvsDB.DumpRow dump = ds.Dump.NewDumpRow();
dump.Dump_Column = MyByteArray; // MyByteArray = byte[] array
dump.SetParentRow(clRow);
ds.Dump.AddDumpRow( dump );
I wish that the Dump that I has just added will be added as a column entry
to the Defect table that when connecting it to a DataGrid control it will be
shown as a link to the Dump table containing the Dump byte[] array.
Instead I get the Defect table ok but its link to the Dump table takes me to
an empty table although there is a filled Dump table present already.
How do I do it right?
The XSD file:
--------------------
<?xml version="1.0"?>
<xs:schema xmlns:mstns="http://tempuri.org/EvsDB.xsd"
xmlns="http://tempuri.org/EvsDB.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
targetNamespace="http://tempuri.org/EvsDB.xsd" elementFormDefault="qualified"
attributeFormDefault="qualified" id="EvsDB">
<xs:element name="EvsDB" msdata:IsDataSet="true"
msdata:EnforceConstraints="False">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Subjet">
<xs:complexType>
<xs:sequence>
<xs:element name="Recipe">
<xs:complexType>
<xs:attribute name="ID" type="xs:string" form="unqualified"/>
</xs:complexType>
</xs:element>
<xs:element name="Defects" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Defect" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ID" type="xs:long"/>
<xs:element name="FrameID" type="xs:long"/>
<xs:element name="Type" type="xs:string"/>
<xs:element name="XCoordinate" type="xs:long"/>
<xs:element name="YCoordinate" type="xs:long"/>
<xs:element name="Shape" type="xs:string"/>
<xs:element name="RedColor" type="xs:unsignedByte"/>
<xs:element name="GreenColor" type="xs:unsignedByte"/>
<xs:element name="BlueColor" type="xs:unsignedByte"/>
<xs:element name="Polygon" type="xs:string"/>
<xs:element name="PictureDump" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Dump" type="xs:base64Binary"
nillable="true" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="PicturePath" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="Path" type="xs:string" nillable="true"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Sectors" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Sector" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string" minOccurs="0"/>
<xs:element name="Top" type="xs:long" minOccurs="0"/>
<xs:element name="Bottom" type="xs:long" minOccurs="0"/>
<xs:element name="Left" type="xs:long" minOccurs="0"/>
<xs:element name="Right" type="xs:long" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
--
Thanks
Sharon