473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

XSD and DataSet how to ???

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
Nov 17 '05 #1
0 986

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill C. | last post by:
Hi, I've got a simple console app that just reads an XML file into a DataSet then prints out a description of each table in the DataSet, including column names and row values for each column. ...
3
by: Jeronimo Bertran | last post by:
Hi, I have an xml file that encapsulates a dataset definition within a set of tags (<dataset>)... here is an example <?xml version="1.0" encoding="utf-16"?> <dataset> <MyTable>...
5
by: Mike | last post by:
I need to expand the DataSet class by inheriting from it and adding functions that work on the data in the tables. However, since I can't upcast how can I get my base DataSet object assigned an...
3
by: JJ | last post by:
Hi, I need to pass a dataset to another win form along with a SqldataAdapter. I don't want to recreate the SqlDataAdapter again either. So to pass to another Win form in my windows form app, do...
5
by: Jason | last post by:
I am having problems understanding how to access a datasource only once, fill a single dataset, and then reference that dataset multiple times through different user controls(ascx) found on the...
2
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and...
15
by: JIM.H. | last post by:
Hello, Can I send a dataset as a parameter into stored procedure and import data to a table in the stored procedure? Thanks, Jim.
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
1
by: matt | last post by:
hello, i have a web app that allows users to query our oracle db and produce a dataset of report data. they then have the option to serialize this data and store it in the database. later, then...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.