CSharp examples for System.Xml:XML Node
Creates DataTable columns given an XmlNode.
// All rights reserved. using System.Diagnostics; using System.Collections.Specialized; using System.Xml; using System.Data; using System;/*ww w . j a va2 s. c om*/ public class Main{ /// <summary> /// Creates columns given an XmlNode. /// </summary> /// <param name="dt">The target DataTable.</param> /// <param name="node">The source XmlNode.</param> protected static void CreateColumns(DataTable dt, XmlNode node) { foreach (XmlAttribute attr in node.Attributes) { dt.Columns.Add(new DataColumn(attr.Name)); } } }