Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / July 2006

Tip: Looking for answers? Try searching our database.

XMLDesigner XSD DataSet Order with Relationships

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Computer - 20 Jul 2006 07:26 GMT
I brought an XSD into the XMLDesigner.  The XSD had two related tables and
it looked like this in .Net's XMLDesigner:

Table 1

---------

BankItem           (Bank Item)

Person                (Person)

Acct                    String

Balance              Decimal

Date                    String

Regulation          String

Table 2

---------

Person                 (Person)

FirstName            String

LastName             String

Phone                   String

In my project I wanted to load the resulting Dataset with data and then use
the Dataset.WriteXML command to produce the XML file.  I want the tags in
the output XML file to be in the order specified in the XSD file and as
shown on the XMLDesigner in .Net.  I used:

myXmlDataDocument = New XmlDataDocument

myXmlDataDocument.DataSet.ReadXmlSchema()

I then added rows to the tables and wrote the XML file with
Dataset.WriteXML.  My process works except the Dataset that is built by the
XMLDesigner puts the (Person) related tag at the bottom of the BankItem area
below the Regulation element instead of above the Acct element as shown in
the designer.  My XML is nested properly, it is just in the wrong order.

If I Right-Click the XMLDesigner and Click "Preview Dataset" under BankItem
I see:

Acct

Balance

Date

Regulation

BankItem ID  (Key Field)

BankItem Person (Relation with its type under it)

The designer is throwing the relation to the bottom of the first table's
element list, which affects the Dataset I am using.  Can I override this and
put my relation back at the top where it is in my XSD?
Andrew Brook - 20 Jul 2006 10:31 GMT
Hiya,

I don't suppose you could post your xsd schema? Or confirm that your schema
explicitly says that the elements must appear in that order. I'm no expert
on XML or on DataSet's but that's the first thing id check :)

ta,
Andrew

>I brought an XSD into the XMLDesigner.  The XSD had two related tables and
> it looked like this in .Net's XMLDesigner:
[quoted text clipped - 65 lines]
> and
> put my relation back at the top where it is in my XSD?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.