C# / Csharp datatable to xml example

A simple example in csharp / C# to save datatable to xml format. DataTable to xml example

using System; using System.Data; public class DataTableToXmlExample { public static void Main() { //adding up a new datatable DataTable dtEmployee = new DataTable("Employee"); //adding up 3 columns to datatable dtEmployee.Columns.Add("ID", typeof(int)); dtEmployee.Columns.Add("Name", typeof(string)); dtEmployee.Columns.Add("Salary", typeof(double)); //adding up [...]