Collection advice needed... 
Author Message
 Collection advice needed...

Hi,

I have some newbie questions regarding collections in C#...
I'm need to store personal information like name, email, phone nr etc of
different persons to keep in a list. Which kind of collection type should I
use? I've noticed that there are array lists and hash tables for instance...
Should I put the personal information in a struct or a class that I store in
the list?

Any advice, hints or examples are welcome.

Regards,
PM



Sat, 28 May 2005 16:42:37 GMT  
 Collection advice needed...
I think a DataTable would come pretty handy:

check out DataTable.Columns.Add("name", typeof(String))....
and  DataTable.Rows

Lennin



Sat, 28 May 2005 17:06:15 GMT  
 Collection advice needed...
PM,

Quote:
> I'm need to store personal information like name, email, phone nr etc of
> different persons to keep in a list. Which kind of collection type should
I
> use? I've noticed that there are array lists and hash tables for
instance...
> Should I put the personal information in a struct or a class that I store
in
> the list?

> Any advice, hints or examples are welcome.

Create a class called:

    "PersonalInformation"

and give that class attributes named:

    "name"
    "emailAddress"
    "telephoneNumber"
    .
    .
    .

Then instantiate the class for each person.  Store the instances of
PersonalInformation in an ArrayList.

Regards,

Randy



Sun, 29 May 2005 00:33:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. In need of advice for choose Collection

2. Experts advice on Collections!

3. A collection inside a collection inside a collection...

4. Need advice for video conferencing

5. programming language advice needed

6. TraceSwitch advice needed

7. advice needed about MFC and .Net

8. Need advice - beginner

9. Need Advice

10. newbie needs advice on using lists

11. to rowlock or not to rowlock need advice

12. libclc: advice about posting code needed.

 

 
Powered by phpBB® Forum Software