Which collection object to use similar to SortedList\Hashtable

  • Thread starter Thread starter Kiran
  • Start date Start date
K

Kiran

Hi,

I need to store two columns of values in an object after getting the
same from a dataset\similar object.

1. I need to sort this data at one place, so I use sortedlist here.

2. In another place, I just need to store the data and pass it to a
business object where it gets further processed, so I use HashTable here.

this is the sample data that I store
1 10.34
2 67.89
6 89.78

presently I use sortedlist and hastable.

is this ok performance wise and is there any other alternative object
that I can use instead of these in VB.Net(2003)


Please provide ur comments.

Thanks
KiranW
 
Well, first I want to ask why you don't just leave it in the DataSet?
Second, what/where/how are you using the data? This can have an influence on
what technique is most efficient. I think that both me and others will be
able to help you better if you supply this information. Good Luck!
 
Hi Nathan,

Firstly thanks for the reply.(No one gave their response for the past
few days)

I get the rows from a grid(rows only selected by the user, I use a
checkbox column for this).

I have two such grids and get two such lists(with two cols: ID and value
in each of the list)

I use a sorted list to sort the data and compare both and do some
calculations.

As a result of this calculations, I add a few rows(two cols: ID, value)
in to new hashtable.

using this hashtable I then make the appropriate database changes.

Is there an alternative object that I can use in vb.net instead of
sortedlist and hashtable(looking at performance....)

Hope you understand, awaiting your reply.

Thanks
Kiran
 
One thing you could try is a multi-dimensional Array, and use Array.Sort()
to sort it. I'm not sure what other suggestions to make, your situation
sounds like the kind where it's hard to know "The Best Solution" without
actually seeing everything. Good Luck!
 
Back
Top