473,395 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Which collection object to use similar to SortedList\Hashtable

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
Feb 16 '06 #1
3 4840
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!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Kiran" <so*****@somewhere.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
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

Feb 18 '06 #2
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

Nathan Sokalski wrote:
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!

Feb 18 '06 #3
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!
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Kiran" <so*****@somewhere.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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

Nathan Sokalski wrote:
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!

Feb 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: maya2000 | last post by:
Hello, Below code has a problem to read a data. It seems the non-primitive data are the reason. How can I save this Map into a file, and read it later? Thanks in advance. ...
10
by: KN | last post by:
I know both are pretty much the same and it comes down to personal choice. But I have to make the choice for the team. Things so far that I am considering 1. XML documentation in C# -- thats...
17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
21
by: Rabbit63 | last post by:
Hi: I want to show a set of records in the database table on the clicnt browser. I have two ways to do this (writen in JScript): 1.The first way is: <% var sql = "select firstname from...
6
by: simon | last post by:
Always when I need data reader in my programs, I simply have functions, which creates it for me: Dim rdr As SqlDataReader dim sql as string sql="myStoredProcedure" rdr =...
4
by: Chris | last post by:
Hi, I think I'm having some problems here with garbage collection. Currently, I have the following code: public struct Event { public int timestamp;
2
by: Ken Varn | last post by:
I want to create a custom collection class that is similar to something like the System.Windows.Forms.Control.ControlCollection. I notice that this collection implements IList, ICollection,...
1
by: emma middlebrook | last post by:
Hi I want to find out what objects are due to receive an event i.e. those that have added themselves as an event handler via +=. Yes, it's a little pointless perhaps (or can anyone give some...
4
by: Michael K. Walter | last post by:
I'd like to create a strongly-typed collection of objects that are indexed by a string value (key is a string). I'd also like to allow users to iterate over the collection using a For-each loop...
1
by: Jeff Haumesser | last post by:
I have a Collection called Grooming. Each object in this collection contains the property GroomingServices of type Collection. I also have a Clone of this Groomings collection called GroomingsInit....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.