• http://www.techneurons.com/career/
  • experienced programming consultants for hire !!!

    Contact Now

    C#.NET Support

    How can we maintain the order of the items that are added to Hashtable

    Posted by Abhishek on Mar 29, 2010
    when i am adding the items to hasthable and trying to display in the same order which i have added.It doesn't sho up in the same order is there any method which we can display the items in the same order as they were added.
    Replied by consultsarath on Mar 29, 2010
    <p>Hashtable orders items in a different way, which looks random, but not actually random. The sorting is based on HashCode value of the item key, and thereby it is not suitable for the purpose you have mentioned.</p> <p>Instead, you can use&nbsp;a simple <strong>Collection </strong>object if you want the items to be retrieved in the same order as you entered, or a <strong>SortedList </strong>in case you want the output to be sorted in ascending or descending order.</p>
    We are experts in Cloud Computing Technologies. We can assist you to build high scalable business applications using Amazon Web Services (Amazon EC2, Amazon S3, Amazon SES, SNS, CloudFront), Windows Azure Platforms - Windows Azure and SQL Server Azure, Google App Engine using Python and Django Framework. We are Expert Programming Consultants available at affordable rates per hour. We work on several technologies - .NET, Python, Google App Engine, PHP, Windows Azure, Amazon Web Services ...