Solved

from dataset to xml

Posted on 2003-11-12
4
442 Views
Last Modified: 2013-11-19
I'm new vb.net and XML.

In my app I'm selecting data from a SQL database into a dataset - no problem.
I can use dataset.writexml method to write out the data as XML but this inserts element tags as per database field names.

I need to write that data out as XML but to a given XML definition.
I've set up a .xsd mapping schema to match up the XML elements with corresponding database fields.

How can I now write out the data from the dataset and get it to use my .xsd mapping schema so that the XML output matches the required output?
Or should I be doing this another way?

Any help most appreciated.

0
Comment
Question by:stantheram
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
TRUENEUTRAL earned 250 total points
ID: 9733676
Why not write a view on the SQL side that renames the fields to match your new definition?

This has the added benefit of letting the database server do the work, rather than the application server.
0
 

Author Comment

by:stantheram
ID: 9739161
Thanks for your response.
I could do that, but it wouldn't sort out the complex types and nested elements properly.

I really would quite like to find out how to use the .xsd mapping file - so I could then run any query I want to, load the query results into a dataset (got that far), and always output in the same XML format.
0
 
LVL 5

Expert Comment

by:TRUENEUTRAL
ID: 10322101
Thank you :)
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question