SortedList.Add : SortedList « System.Collections « C# / C Sharp by API






SortedList.Add

  
    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));
      }
   }
}

   
    
  








Related examples in the same category

1.SortedList.ContainsValue()
2.SortedList.Count
3.SortedList.GetByIndex
4.SortedList.GetKey
5.SortedList.GetKeyList
6.SortedList.GetValueList
7.SortedList.IndexOfKey
8.SortedList.Keys
9.SortedList.Remove
10.SortedList.RemoveAt
11.SortedList.Values