ReadXml : DataSet : Database C# Source Code


Custom Search

C# Source Code » Database » DataSet »

 

ReadXml








    




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

class Program {
    static void Main(string[] args) {
        DataSet thisDataSet = new DataSet();
        thisDataSet.ReadXml("nwinddata.xml");

        foreach (DataRow custRow in thisDataSet.Tables["Customers"].Rows) {
            Console.WriteLine("Customer ID: " + custRow["CustomerID"] +
                              " Name: " + custRow["CompanyName"]);
        }

        Console.WriteLine("Table created by ReadXml is called {0}",
                           thisDataSet.Tables[0].TableName);
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Database
» DataSet