Solved

from dataset to xml

Posted on 2003-11-12
4
431 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
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
TRUENEUTRAL earned 250 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you :)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now