Create a XML file from Database

Discussion in 'ASP .Net' started by shapper, Oct 18, 2006.

  1. shapper

    shapper Guest

    Hello,

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

    Thanks,
    Miguel
    shapper, Oct 18, 2006
    #1
    1. Advertising

  2. shapper

    Steven Nagy Guest

    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
    Steven Nagy, Oct 18, 2006
    #2
    1. Advertising

  3. shapper

    shapper Guest

    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

    Steven Nagy wrote:
    > 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
    shapper, Oct 18, 2006
    #3
  4. shapper

    Siva M Guest

    Siva M, Oct 18, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. casper
    Replies:
    0
    Views:
    9,035
    casper
    Apr 24, 2006
  2. Replies:
    0
    Views:
    836
  3. Dave
    Replies:
    1
    Views:
    978
    Juan T. Llibre
    Jun 8, 2007
  4. casper

    CREATE DATABASE permission denied in database 'master'

    casper, Apr 24, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    229
    casper
    Apr 24, 2006
  5. Erik Wasser
    Replies:
    5
    Views:
    437
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page