There're a few choices in the System.Collections and
System.Collections.Specialized namespace. If you want only to check if the
object has been added or not, you could use GetHashCode() method in the
string that you're adding and throw it into a sorted array. That way you
will be comparing integers instead of strings (which is way more faster).
Or if you want to get back to the original object, you can use
StringDictionary and use ContainsKey() method to check if an item is already
in the dictionary.
For case insensitive matches, you can try CaseInsensitiveHashCodeProvider
class.
-vJ
"Seelan" <as**@asas.com> wrote in message
news:u6*************@tk2msftngp13.phx.gbl...
Can u explain how to create hash tables please? Im kind of new here...
"Vijaye Raji" <no*************@hotmail.com> wrote in message
news:#U**************@TK2MSFTNGP12.phx.gbl... You can use FindStringExact to find the text of your item and not add
them
if it's already there.
Or if you have a ton of items and don't want to have the perf hit, you
could create a hash table; check against the hash table before adding to the
list and populate it as you fill the list.
HTH
-vJ
"Seelan" <as**@asas.com> wrote in message
news:OW**************@TK2MSFTNGP11.phx.gbl... > Hey Guys,
> I have read a table from SQL Server to a Dataset called ds. Now I want > to list the items of one column to a DropDown List...I can do this
> perfectly
> but i want ht e list to contain DISTINCT items without having to call the > SQLCommand again!
> Please help thanks!
> Seelan-
>
>