Create a XML file from Database

S

shapper

Hello,

I need to add a XML file from an Access database.
Could someone tell me what would be the best approach?

Thanks,
Miguel
 
S

Steven Nagy

Sorry, do you mean you need to create an XML file for the schema of the
database, or for the content? Or do you mean that you have an XML file
that you want to store in a database?

The Dataset class allows you to save your schema, data, or both as XML.
You can fill a dataset with data from your access database using a
System.Data.OleDb.OleDbDataAdapter.

Steven
 
S

shapper

Hi,

I have a query in my database which delivers me a list of records with
5 fields:
title, description, link, pubDate and author

I know how to create the dataset. So that part is done.

My problem is how to create the XML file.
The XML schema is the one used in RSS 2.0.

For example, I need to create the following XML file:

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title></title>
<description></description>
<image>
<url></url>
<title></title>
<link></link>
<width></width>
</image>
<item>
<title></title>
<description></description>
<link></link>
<pubDate></pubDate>
<author></author>
</item>
</channel>
</rss>

Nodes like "title" should be created just using a string:
Node_Title.Value = MyTitle

Child Nodes like "image > url" should also be created just using a
string:
ChildNode_ImageUrl.Value = MyImageUrl

The Items child nodes should be filled with the dataset information.

Could you tell me how to do this?

Thanks,
Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top