472,993 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

dataset and xsd

Hi group...

I am having big difficulties with dataset and xsd schemas.
First I dedicate a specific schema to a dataset. Then I use an adapter
to fill each table in the dataset.
But the problem is, when I use the write or getxml on the dataset, the
result is NOT like the schema I provided the dataset which I think
should not be possible.
I hope to get some idea how to correct my problem.

Here is more detailed information:

I have a databse with 3 tables:
'InformationData' which holds IdNumber, Name.
'Content' which holds Name, Value
'Setup' which holds Identifyer, Value.

My Schema looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="InformationSet">
<xs:complexType>
<xs:sequence>
<xs:element name="InformationData">
<xs:complexType>
<xs:sequence>
<xs:element name="IdNumber" type="xs:string" />
<xs:element name="Name" type="xs:string" />
<xs:element name="Content" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string" />
<xs:element name="Value" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Setup" minOccurs="0"
maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Identifyer" type="xs:string" />
<xs:element name="Value" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

What i am doing now is:
myDataset.ReadXmlSchema(schemaFile); //schemaFile is the above schema
/* Some connection to the first table in the db here */
myAdapter.MissingSchemaAction = MissingSchemaAction.Error;
myAdapter.Fill(myDataset, "InformationData");
/* Some connection to another table in the db here */
myAdapter.MissingSchemaAction = MissingSchemaAction.Error;
myAdapter.Fill(myDataset, "Content");
/* Some connection to third table in the db here */
myAdapter.MissingSchemaAction = MissingSchemaAction.Error;
myAdapter.Fill(myDataset, "Setup");

What I am expecting from the above xsd, when running a .write()
or .getxml() on the dataset is this:

expected.xml:
<?xml version="1.0" standalone="yes"?>
<InformationSet>
<InformationData>
<IdNumber>Test</IdNumber>
<Name>Pony</Name>
<Content>
<Name>SomeName</Name>
<Value>SomeValue</Value>
</Content>
<Setup>
<Identifyer>SomeIdentifyer</Identifyer>
<Value>SomeValue</Value>
</Setup>
</InformationData>
</InformationSet>

But this is not the case! Instead I am getting this:

extracted.xml:
<?xml version="1.0" standalone="yes"?>
<InformationSet>
<InformationData>
<IdNumber>Test</IdNumber>
<Name>Pony</Name>
</InformationData>
<Content>
<Name>SomeName</Name>
<Value>SomeValue</Value>
</Content>
<Setup>
<Identifyer>SomeIdentifyer</Identifyer>
<Value>SomeValue</Value>
</Setup>
</InformationSet>

As you can see, there is just three ordinary tables in the dataset/xml
(you can see this by the position of the InformationData-tag. Somehow
the xsd is completely ignored.
When I try to load the "wrong" extracted xml from above into a dataset
with the schema provided (by using the .readxml() and .readxmlschema I
get an error. But when doing so with the one I expect I get no errors.

Can someone tell my how to fill the dataset correct? :o)
I need a xml which looks like the expected.xml

Regards
- rick -
Jun 1 '08 #1
0 1604

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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.