Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. generate custom xml from a dynamic dataset

generate custom xml from a dynamic dataset

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-netxmlhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nilarya
    wrote on last edited by
    #1

    Hi All, I dont know if this question is for this forum or I should post it on XML forum. I will transfer the question if you think it is more suitable on that forum. However, I have a asp.net application in C# where I have a dataset which I can transfer to xml by using the following simple codeblock

    string result;
    using (StringWriter sw = new StringWriter())
    {
    ds.WriteXml(sw);
    result = sw.ToString();
    }

    It generates the default xml of the table structure like the following:

    1
    untitled.bmp
    Some Path
    800
    190
    256
    1
    image/jpeg
    

    But I want the xml to be generated in the following format

    1
    untitled.bmp
    Some Path
    800
    190
    256
    1
    image/jpeg

    this is an example with dataset having one row. there are various rows in a dataset. In my application, I wont be knowing the structure of the dataset beforehand. i.e. there can be a resulting dataset where I have more columns than the one described in the example. How should I go about this? Any help would be much appreciated. Thanks.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups