.NET Framework Bookmark and Share   
 index > .NET Base Class Library > Retrieving SortedList values
 

Retrieving SortedList values

Hi,

I have SortedList (Records1). That I am storing data in the format of

1. Records1.Add(Item.Date.ToShortDateString() + Item.ChanceryCode + Item.Reference.ToString() + Item.Year.ToString(), Item);

2. The keys for Record1 are

1/1/2006I11833802002
1/1/2007C12473522004
1/1/2007I12473342002
1/1/2007I12473352002
1/1/2007I12473362002
1/1/2007I12473382002
1/1/2007I12473442004
1/1/2007I12473452004
1/1/2007I12473532004
1/10/2006C11867322001
1/10/2006C11869032003

My question is
I have to iterate sortedlist year wise to get values and then I will do calculations Item taxes
for Example :

2001 has
1/10/2006C11867322001

2002 has
1/1/2007I12473342002
1/1/2007I12473342002
1/1/2007I12473352002
1/1/2007I12473362002
1/1/2007I12473382002

2003
1/10/2006C11869032003

2004
1/1/2007C12473522004
1/1/2007I12473442004
1/1/2007I12473452004
1/1/2007I12473532004


Finally I willprint

2001 1000.00 ( It's Total += Item.Tax for this 2001 yr)
2002 2300.00 ( It's Total += Item.Tax for this 2001 yr)
...
....


Please provide help on this.
Thanks in advance

Srikanthv
Everybody, please note that this issue has already been solved on another forum.
The original poster should've announced that.

Regards

Marcel Nita
Everybody, please note that this issue has already been solved on another forum.
The original poster should've announced that.

Regards

Marcel Nita

Hi srikanthv,

I did some research from the websites and found this issue had been resolved from this thread - http://www.codeguru.com/forum/showthread.php?t=442690.Please try to check it out for detailed discussions.

Regards,

This response contains links reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.
Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

Ji Cheng Wang - MSFT

You can use google to search for other answers

Custom Search

More Threads

• metaclass/class references
• Get Return Value from reflection object
• Can I call Hashtable.getItem by serveral threads at the same time ?
• Will NGEN 2.0 work on 1.1 assemblies
• Converting a bitmap to a 2D intensity array then extracting a window from it
• extract XML elements from main document
• In User Control for BindingNavigator cant see its Properties in property Window C#
• Dynamic controls (buttons) over PictureBox not displaying correctly.
• MSN notify
• Sending content of file over serial connection.