Pages

Showing posts with label Converting the xml returned from share point list service to an data table. Show all posts
Showing posts with label Converting the xml returned from share point list service to an data table. Show all posts

Friday, July 19, 2013

Converting the xml returned from share point list service to an data table

Converting an xml returned from share point list service to a data table is very easy .The code to do that is as follows

using System.Xml;


public DataTable ConvertToDataSet(XmlNode xmlListItems){

      DataSet datasetList = new DataSet();
      XmlTextReader xmlTxtReader = new XmlTextReader(xmlListItems.InnerXml, XmlNodeType.Element, null);      datasetList.ReadXml(xmlTxtReader);

      DataTable datatable = datasetList.Tables[1];
      return datatable;}

Where listXml is the xml returned from the share point list service _vti_bin\lists.asmx