On a C#.net site I've been asked to take over the programmer converts an XmlDoc to a dataset.
XmlDoc resultDoc = new XmlDoc();
...
resultDoc.LoadXml(text);
resultDoc.LoadXml(resultDoc.SelectSingleNode("//return").InnerXml);
DataSet ds = new DataSet();
ds.ReadXml((new StringReader(resultDoc.OuterXml)));
RadioButtonList1.DataSource = ds;
RadioButtonList1.DataTextField = "business";
RadioButtonList1.DataBind();
Ive seen this done before on a flat xml file, but the xml being used in this case (from a web service) is something like
<ibccompany:companyxmlns:ibccompany="IBC:company">
<companyID>
<localID>0x00000000000D0830</localID>
<BLID>S4D</BLID>
</companyID>
<business>Test</business>
...
<address>
<building>10</building>
<street />
...
</address>
<tel />
...
In his code he uses the line
RadioButtonList1.DataTextField = "business";
to get the business name. this is fine and works, but they want me to now use the building number instead of the business name. I can't think how I refer to this. Ive tried
RadioButtonList1.DataTextField = "building";
RadioButtonList1.DataTextField = "address/building"; // unlikely but in desperation tried
even
RadioButtonList1.DataTextField = "address";
in the hope it might give the entire address with tabs that I could strip the building out of but it doesn't recognise
Is there anyway I can refer to the building field in the ds, or is it simply not converted
Thanks
AndyH1
XmlDoc resultDoc = new XmlDoc();
...
resultDoc.LoadXml(text);
resultDoc.LoadXml(resultDoc.SelectSingleNode("//return").InnerXml);
DataSet ds = new DataSet();
ds.ReadXml((new StringReader(resultDoc.OuterXml)));
RadioButtonList1.DataSource = ds;
RadioButtonList1.DataTextField = "business";
RadioButtonList1.DataBind();
Ive seen this done before on a flat xml file, but the xml being used in this case (from a web service) is something like
<ibccompany:companyxmlns:ibccompany="IBC:company">
<companyID>
<localID>0x00000000000D0830</localID>
<BLID>S4D</BLID>
</companyID>
<business>Test</business>
...
<address>
<building>10</building>
<street />
...
</address>
<tel />
...
In his code he uses the line
RadioButtonList1.DataTextField = "business";
to get the business name. this is fine and works, but they want me to now use the building number instead of the business name. I can't think how I refer to this. Ive tried
RadioButtonList1.DataTextField = "building";
RadioButtonList1.DataTextField = "address/building"; // unlikely but in desperation tried
even
RadioButtonList1.DataTextField = "address";
in the hope it might give the entire address with tabs that I could strip the building out of but it doesn't recognise
Is there anyway I can refer to the building field in the ds, or is it simply not converted
Thanks
AndyH1