Hello, Yes, the code as you have it will not work. You need to sort the collection before you write the information. You can create a custom Comparer (by implementing IComparer interface -- see http://msdn.microsoft.com/en-us/library/system.collections.icomparer.aspx ), add the items to an ArrayList...