471,627 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

CollectionBase

wg
I am attempting to create a collection where store and modify multiple
entries (i.e. Key, FirstName, LastName, Address, City, Phone, etc). I have
attempted to use the CollectionBase but have not been able to add more that
2 objects. Can anyone tell me how to do this or the best way.

Thanks
Feb 9 '06 #1
3 2502
Are all those part of one record? Can you explain a little more about what
you want. Collections are usually (but not always) meant to store data of
the same (or similar) data.

Can you provide some simple code showing what you are doing?

"wg" <wg@hotmail.com> wrote in message
news:cf*****************@bignews3.bellsouth.net...
I am attempting to create a collection where store and modify multiple
entries (i.e. Key, FirstName, LastName, Address, City, Phone, etc). I have
attempted to use the CollectionBase but have not been able to add more that
2 objects. Can anyone tell me how to do this or the best way.

Thanks

Feb 9 '06 #2
Hi,

I see that you want to create a custom collection class. Can you please
tell me what all you have done so far?

CollectionBase is an abstract class and can be used for creating
strongly-typed collections. Normally, you inherit from CollectionBase
and implement what all methods are exposed by your class. How did you
add items to your custom collection class? You must have used the
IList.Add method, right?

And, can you please tell me your exact requirement/usage scenario? A
very basic sample scenario would be "Class" and "Student" (each class
has a collection of students), where you create a class named
StudentCollection(or any other name of your choice) which inherits
CollectionBase. This is done mostly only you want a strongly-typed
collection for holding Student objects only.

Regards,
Jim
<<Work smart, not hard!>>

Feb 9 '06 #3
wg
Thanks to both for the insight. I will start working on a Class to inherit
the collectionbase. But in the meantime here is what I am trying to do in
the end.

I want to create a class that will load a *.csv (comma delimeted file) and
parse out each column. I will never know the length of the file so I know I
have to use an arraylist. Each column will have a variable in the array per
say. Then in my program I want access to each of these parameters. I also
want the ability to change the value of a few of the variables that were
loaded. This information will be used throughout the program so I will make
the class a Singleton.

So far I have been able to open and load the csv file, make the class a
singleton. But as of yet I have not been able to load each column variable
into its own variable for access outside.

Thanks again for the direction.
wg
"wg" <wg@hotmail.com> wrote in message
news:cf*****************@bignews3.bellsouth.net...
I am attempting to create a collection where store and modify multiple
entries (i.e. Key, FirstName, LastName, Address, City, Phone, etc). I have
attempted to use the CollectionBase but have not been able to add more that
2 objects. Can anyone tell me how to do this or the best way.

Thanks

Feb 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by m. pollack | last post: by
2 posts views Thread by m.pollack | last post: by
5 posts views Thread by Eric Johannsen | last post: by
2 posts views Thread by Samuel R. Neff | last post: by
3 posts views Thread by Tony Johansson | last post: by
reply views Thread by leo001 | last post: by

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.