NameValueCollection or HashTable
-
Hello everyone: I need to use a collection technique but I am not sure which one will be best for my situation. I have relational data that I need to store; I have a table that has Keys and another table has values, each KEY may contain mulitple values. Both KEY and VALUE are string, can you suggest me which (NameValueCollection or HashTable) I should use? Thanks a lot.
-
Hello everyone: I need to use a collection technique but I am not sure which one will be best for my situation. I have relational data that I need to store; I have a table that has Keys and another table has values, each KEY may contain mulitple values. Both KEY and VALUE are string, can you suggest me which (NameValueCollection or HashTable) I should use? Thanks a lot.
-
Hello everyone: I need to use a collection technique but I am not sure which one will be best for my situation. I have relational data that I need to store; I have a table that has Keys and another table has values, each KEY may contain mulitple values. Both KEY and VALUE are string, can you suggest me which (NameValueCollection or HashTable) I should use? Thanks a lot.
I'm a newbie so take my advice with a grain of salt, but it seems like NameValueCollection was designed with exactly that in mind. The alternative would be a HashTable with arrays of strings for the values, but NameValueCollection takes care of some of the dirty work there -- although it does get a little messy when you only want to access one of the many values stored under a key. That will be $0.02 please. Cash or charge?
-
Hello everyone: I need to use a collection technique but I am not sure which one will be best for my situation. I have relational data that I need to store; I have a table that has Keys and another table has values, each KEY may contain mulitple values. Both KEY and VALUE are string, can you suggest me which (NameValueCollection or HashTable) I should use? Thanks a lot.
They are both the same. For the value bit you simple need to use another Hashtable or ArrayList. Seems tricky at 1st due to the extra casting, but once u write a few of them its like writing a for loop :p