If you are only looking up the first column, so you have like a key-value
relationship, I would lean pretty heavily towards either the HashTable, the
StringDictionary, or the NameObjectCollectionBase. That's really what
they're made for, and the access is really fast.
The differences between them: A straight Hashtable accepts type object as
the key and returns type object as the value (so you can pass a string or
whatever as the key, and you will have to cast the value back:
myHashTable.Add("TheKey", aValue);
myType value = (myType)myHashTable["TheKey"];
A StringDictionary expects to be a list of string pairs, so that the add
method expects only strings:
myStringDictionary.Add("TheKey", "TheValue")
string value = myStringDictionar["TheKey"]
A NameObjectCollectionBase is an abstract class that you override to
customize it to your collection needs:
myNameObjectCollection.Add("TheKey", aValue);
myType value = myNameObjectCollection["TheKey"];
The benefit of the hashtable/dictionary is extremely speedy lookup.
Working where you want to access multiple columns is a little more
interesting. Right now, the only thing I have is brute force (2 hashtables,
swapping the key/value roles). We are actually have that issue as an "item
to solve" on the drawing board now, but we haven't gotten to it yet. If you
want, we can swap info on how to solve it as we discover. The downside is
that I expect it to be a couple of weeks before that particular item ends up
on anyone's plate over here.
Dan V. said:
Similar to my reply, Is there a faster / better method: With one key
difference; What about if I only lookup in the first column to find the
value in the 2nd column, as opposed to searching either column?
"I basically would like a 2 column array or whatever that will be
static,
as
in values won't change after I load them and I would like to fairly quickly
search for a value in -ONLY THE FIRST- column and either: 1. See if the
value exists or 2. get the value in the other column...."
array -
it
use