473,404 Members | 2,114 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,404 software developers and data experts.

Collection

Hi guys;

I created a class that inherits from DictionaryBase class.
The thing is that I want to allow the user when using my class to enter
duplicate keys in the collection like;

Dim myCl as new MyDictionary
myCl.Dictionary.Add("Mike", AnObject)
myCl.Dictionary.Add("Mike", AnObject2)
myCl.Dictionary.Add("Mike", AnObject3)

how can I achieve this inhering from DictionaryBase?

Thanks guys!
Jan 6 '06 #1
3 1331
Mike,

I think that all of the .Net key-value collections require unique, non-null
keys.

Kerry Moorman
"Mike" wrote:
Hi guys;

I created a class that inherits from DictionaryBase class.
The thing is that I want to allow the user when using my class to enter
duplicate keys in the collection like;

Dim myCl as new MyDictionary
myCl.Dictionary.Add("Mike", AnObject)
myCl.Dictionary.Add("Mike", AnObject2)
myCl.Dictionary.Add("Mike", AnObject3)

how can I achieve this inhering from DictionaryBase?

Thanks guys!

Jan 6 '06 #2
"Kerry Moorman" <Ke**********@discussions.microsoft.com> schrieb:
I think that all of the .Net key-value collections require unique,
non-null
keys.


Exception: The 'NamedValueCollection' which store all values for a certain
key in a single string. However, this is not a very flexible solution.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 7 '06 #3


maybe i am thinking to simplistic here :-)

but why don`t you just add the objects to a object array and store them
under one name in the dictionary

regards

Michel Posseth [MCP]


"Mike" <mi**@hitnext.com> wrote in message
news:uR**************@TK2MSFTNGP09.phx.gbl...
Hi guys;

I created a class that inherits from DictionaryBase class.
The thing is that I want to allow the user when using my class to enter
duplicate keys in the collection like;

Dim myCl as new MyDictionary
myCl.Dictionary.Add("Mike", AnObject)
myCl.Dictionary.Add("Mike", AnObject2)
myCl.Dictionary.Add("Mike", AnObject3)

how can I achieve this inhering from DictionaryBase?

Thanks guys!

Jan 8 '06 #4

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

Similar topics

8
by: Generic Usenet Account | last post by:
To settle the dispute regarding what happens when an "erase" method is invoked on an STL container (i.e. whether the element is merely removed from the container or whether it also gets deleted in...
5
by: Kurt Bauer | last post by:
I have an ASP group calendar application which pulls calendar data from Exchange via webdav into an XML string. I then loop the XML nodes to populate a collection of appointments. Finally I use...
18
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are...
11
by: Pavils Jurjans | last post by:
Hello, There's some confusion about the purpose and difference between these handy classes... First, both of them are holding number of key - value pairs, right? Then, I see that there may be...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
6
by: Michael D. Ober | last post by:
In VB 6, the loop iterator v in the following code must be a variant. dim v as variant dim c as new collection for each v in collection ... next v What is the general translation in VB 7.1...
3
by: Matt Michael | last post by:
I have a listview control and a collection object right now that I'm trying to pass information to and from. Whenever I click on the checkbox, I want it to remove certain listview items and add...
10
by: Chet Cromer | last post by:
I am creating a set of base classes and sub classes to use throughout a program I'm developing. The base class represents a generic "lookup table" from my database that contains lists of things...
6
by: Scott M. Lyon | last post by:
As I mentioned in my other post, I'm attempting to, using COM Interop so I can update existing VB6 code to (for several specific functions) return a Hashtable from a .NET library. I've had...
6
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.