generate custom xml from a dynamic dataset
-
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/jpegthis 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.