473,405 Members | 2,421 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,405 software developers and data experts.

Eliminating extra tables during XSD to DataSet conversion

Converting an XML schema to a DataSet is very easy under .NET.
However, the DataSets that I get after the conversion is done are
rather messy.

The problem is that the schema is organized into sections, and for
every enclosing tag .NET creates a runt table with nothing in it but
an auto-generated ID and a link to the parent table.

While I do get all of the tables I want, I also get a dozen other
spurious tables like the one I described.

I've tried messing with IsDataSet="false" and looking for examples on
the Web and in this group, but almost all of the examples show
IsDataSet="true". When I change it to "false" for any of the enclosing
tags (for which I don't want tables generated), .NET decides to
produce no tables for those tags or any tags that they enclose.

Does anyone know what IsDataSet="false" was meant to do? Does anyone
know how to get rid of those annoying extra tables that clutter up the
DataSets?

Here is an example.

<schema id="cod"
xmlns:de="dataExport"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
targetNamespace="dataExport"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">

<element name="exportedData" >
<complexType>
<sequence>
<element name="moduleInfo" type="de:moduleInfoType"/>
<element name="customers" type="de:CustomersType" />
</sequence>
</complexType>
</element>

<complexType name="moduleInfoType">
<attribute name="fullName" type="string"/>
<attribute name="companyName" type="string"/>
<attribute name="date" type="dateTime"/>
</complexType>

<complexType name="CustomersType">
<sequence>
<element name="customer" type="de:CustomerType" minOccurs="1"
maxOccurs="unbounded" />
</sequence>
</complexType>

<complexType name="CustomerType">
<attribute name="code" type="string" use="required" />
<attribute name="name" type="string"/>
</complexType>

</schema>

If I load this into .NET using the ReadXmlSchema() method, I get a
"customers" table and a "customers_Id" in the "customer" table,
neither of which is of any use. The "customers" table contains only a
"customers_Id", and, given the structure of the XML, there will only
ever be one of them.

Is there something I can add to the XML schema to instruct
ReadXmlSchema() that I don't need a "customers" table and its
associated relationship with "customer"?
Nov 11 '05 #1
0 1530

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

Similar topics

5
by: gordy | last post by:
edit: this came out longer than I thought, any comments about anything here is greatly appreciated. thank you for reading My system stores millions of records, each with fields like firstname,...
28
by: Jeff Lanfield | last post by:
Suppose I have users that can belong to organizations. Organizations are arranged in a tree. Each organization has only one parent organization but a user maybe a member of multiple organizations....
2
by: airkart | last post by:
Hello, I've scoured groups and the web, and haven't found a question like mine answered. I'm using Visual Studio 2003 with the Crystal Reports it comes bundled with and SQL Server 2000....
4
by: Al Christoph | last post by:
I have a number of datasets that contains lots of engineering type data. Things are in lengths, forces, energies, times, etc etc. The datasets have two underlying natures: 1. The product dataset...
1
by: Shelby | last post by:
Problem: My company generates its own data export from a propietary database. These (free) tables can be read in C#.NET using a Visual FoxPro driver (vfpoledb). I can read each of the six tables...
4
by: pitcher17 | last post by:
I'm sure this is really simple to do but I'm at a loss. I have a dropdownlist object that I have bound to my dataset. That works fine. However, what I want to do is add an extra static item as...
0
by: bboyd | last post by:
:?: I have a stored procedure that returns 2 tables. One table with 8 columns and one table with 2 columns. I have set up a typed dataset that is similar to the data returned. However, in my typed...
3
by: Chris | last post by:
Hi, I am trying to load 3 xml files into one dataset like dsXML.ReadXml(Server.MapPath("file1.xml") dsXML.ReadXml(Server.MapPath("file2.xml")) dsXML.ReadXml(Server.MapPath("file3.xml")) I am...
0
by: dakvanslam | last post by:
I am new to VB .NET and SQL Server, so I apologize if this is a basic question. I am using Visual Studio 2005 with SQL Server Express. Below is the code in question: ChosenProjectName =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.