I would suggest takign a look at System.Collections.SortedList. I found it
to be quite useful for something like this. In my scenario the keys were
what I was sorting on. If you can use the key as the field you need for
sorting then you are set.

As for an entry in a field of the data being stored you will have to search
over every item for this since they won't be sorted then.

-Bill Conroy


On Thu, 23 May 2002 08:23:47 -0700, Greg Gates <[EMAIL PROTECTED]>
wrote:

>Hello everyone:
>
>I have two basic questions regarding hashtables and structs.
>
>1) Is there any point in using a struct if the struct contains a string,
>given that a string is a reference type?
>
>2) What is the most efficent way to sort and filter a hashtable in .NET.
>For example, if I have a hashtable that contains the following key/values:
>
>A,object1
>B,object2
>C,object3
>
>object1 has a foo field with a value of 4
>object2 has a foo field with a value of 1
>object3 has a foo field with a value of 2
>
>What is the quickest way to retrieve an ordered subset of the items where
>the foo field is less than or equal to 3?
>
>thanks, Greg
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to