Convert XMLElement to DataTable


Below is the code to convert an XMLElement object containing values to a DataTable. The XMLElement tag names will be the column headings in the DataTable. public DataTable ConvertXmlElementToDataTable(XmlElement xmlElement, string tagName) { XmlNodeList xmlNodeList = xmlElement.GetElementsByTagName(tagName); DataTable dt = new DataTable(); int TempColumn = 0; foreach (XmlNode node in xmlNodeList.Item(0).ChildNodes) { TempColumn++; DataColumn dc... Continue Reading →

Advertisements

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: