Using DataTable to read Xml : Xml DataTable « XML « C# / CSharp Tutorial






using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

    class Program
    {
        static void Main(string[] args)
        {
            DataTable dt = new DataTable("Employees");
            dt.ReadXml("Employees.xml");
            DataTableReader dtr = dt.CreateDataReader();
            while (dtr.Read())
            {
                Console.WriteLine(dtr["EmployeeID"]);
                Console.WriteLine(dtr["FirstName"]);
                Console.WriteLine(dtr["LastName"]);
            }
            
        }
    }








30.29.Xml DataTable
30.29.1.Update DataTable and output Xml
30.29.2.Using DataTable to read Xml