i have a webservice (wsdl) generated from a java project. its output is getting as xml format. something like this
<?xml version="1.0" encoding="UTF-8"?><list><map><entry key="aid">160608</entry><entry key="aDate">2013-10-24 00:00:00.0 IST</entry><entry key="insuranceType">Self Pay</entry><entry key="status">New</entry><entry key="pid">160576</entry><entry key="pChartno" /><entry key="lName">Mathur</entry><entry key="fName">Gaurav</entry><entry key="mName">mathur</entry><entry key="gender">Male</entry><entry key="ssn" /><entry key="providerId">2030</entry><entry key="providerFname">lakshman</entry></map></list>
in my cs file i parse the xml and put the result in a dataset. here is my code
DataSet dsresult = new DataSet();
XmlDocument xml = new XmlDocument();
xml.LoadXml("--XML String From Webservice Here--");
XmlElement exelement = xml.DocumentElement;
XmlNodeReader nodereader = new XmlNodeReader(exelement);
dsresult.ReadXml(nodereader, XmlReadMode.Auto);
return dsresult;
now i bind the dataset to a gridview and it show only this
how can i get the key from each node ie, from <entry key="aid">
and display "aid" and other keys as table head?
cs code will be helpful.
i want a grid data like this (Click here for grid image)
EDIT 1
For single row data,Sam's code is working. but when i input an xml string like this
<?xml version="1.0" encoding="UTF-8"?><list><map><entry key="aid">173661</entry><entry key="aDate">2013-10-28 00:00:00.0 IST</entry><entry key="insuranceType">Self Pay</entry><entry key="status">Serviced</entry><entry key="pid">163686</entry><entry key="pChartno" /><entry key="lName">Bec&&kwith</entry><entry key="fName">Burt</entry><entry key="mName" /><entry key="gender">Male</entry><entry key="ssn" /><entry key="providerId">137935</entry><entry key="providerFname">test</entry></map><map><entry key="aid">173675</entry><entry key="aDate">2013-10-28 00:00:00.0 IST</entry><entry key="insuranceType">Self Pay</entry><entry key="status">New</entry><entry key="pid">2038</entry><entry key="pChartno" /><entry key="lName">Velusamy </entry><entry key="fName">Anand</entry><entry key="mName">M</entry><entry key="gender">Male</entry><entry key="ssn">12345690</entry><entry key="providerId">137935</entry><entry key="providerFname">test</entry></map><map><entry key="aid">173679</entry><entry key="aDate">2013-10-28 00:00:00.0 IST</entry><entry key="insuranceType">Self Pay</entry><entry key="status">Serviced</entry><entry key="pid">140417</entry><entry key="pChartno" /><entry key="lName">alex</entry><entry key="fName">pandian</entry><entry key="mName" /><entry key="gender">Male</entry><entry key="ssn" /><entry key="providerId">137935</entry><entry key="providerFname">test</entry></map></list>
it shows this error:-"There are multiple root elements"