Add element to SortedList : SortedList : Collections Data Structure C# Source Code


Custom Search

C# Source Code » Collections Data Structure » SortedList »

 

Add element to SortedList









    


    using System;
    using System.Collections;

class Class1 {
   static void Main(string[] args) {
      bool ByEmp = false;
      SortedList Emps = new SortedList();

      Emps.Add("500", "A");
      Emps.Add("502", "C");
      Emps.Add("501", "B");
      Emps.Add("503", "D");
      
      for(int k=0; k<Emps.Count; k++) {
        Console.WriteLine("\t{0}\t{1}", Emps.GetKey(k), Emps.GetByIndex(k));
      }
   }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Collections Data Structure
» SortedList