Project is in asp.net web service version 2.0 language C#.
I have an xsd schema consisting of 6 elements, 1 element inside another one.
example of xml file: <a> <a1><a2 id=23 name =""/> </a1></a>
<b><b1><b2 id="" name=""/></b1></b>
And I want to create an xml file by that schema.
So I'm creating a dataset and reading the schema. Then I'm modifying some rows in some tables. And then i'm returning the xml from the dataset. The problem is that when i'm doing dset.getXML() , it's returning only the tags that have the attributes. such as:
<xml><a2 id=23 name =""/><b2 id="" name=""/> </xml>
So how do i fix it so i display the full xml structure from the dataset?
The code is the following:
DataSet dset = new DataSet();
dset.ReadXmlSchema(Server.MapPath("test.xsd"));
//add data for table "a2"
dset.Tables[2].Rows.Add(new object[] { "10", "europe" });
//add data for table "b2"
dset.Tables[5].Rows.Add(new object[] { "1", "march"});
return dset.GetXml();
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).