CSharp examples for System.Xml:XML Attribute
Copy XML Attributes
// All rights reserved. using System.Diagnostics; using System.Collections.Specialized; using System.Xml; using System.Data; using System;/* w w w.ja v a 2s .c o m*/ public class Main{ public static void CopyAttributes(DataRow fromRow, XmlNode toNode) { foreach (DataColumn col in fromRow.Table.Columns) { CreateAttribute(toNode, col.ColumnName, fromRow[col.ColumnName].ToString()); } } }