Is there an MFC 'CMAP' equivalent in C# ?

  • Thread starter Thread starter Bishman
  • Start date Start date
B

Bishman

.....Or can any one suggest a method of searching an array and retrieveing an
object associated with the value I am searching for ?

I have an 'Advisor' object holding info about... Sales Advisors.

I need to hold these in an Array, but need to be able to retrieve and update
the object values using the AdvisorsID value.

In C++ I would have used a CMAP object, so is there an equivalent in C# or
do I need some other sort of Multidimensional array ?

Help appreciated

Thanks.

Jon
 
Bishman,

If you are using .NET 1.1 or before, then use the Hashtable class in the
System.Collections namespace. If you are using .NET 2.0 or above, then use
the Dictionary<TKey, TItem> class in the System.Collections.Generic
namespace.

Hope this helps.
 
Absolutely spot on Nicholas. Using .NET 2.0 so used the Dictionary class.
Tested all working sweet !

You dont know how much stress you have just relieved me of. Thanks !!

Jon.


Nicholas Paldino said:
Bishman,

If you are using .NET 1.1 or before, then use the Hashtable class in
the System.Collections namespace. If you are using .NET 2.0 or above,
then use the Dictionary<TKey, TItem> class in the
System.Collections.Generic namespace.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Bishman said:
....Or can any one suggest a method of searching an array and retrieveing
an object associated with the value I am searching for ?

I have an 'Advisor' object holding info about... Sales Advisors.

I need to hold these in an Array, but need to be able to retrieve and
update the object values using the AdvisorsID value.

In C++ I would have used a CMAP object, so is there an equivalent in C#
or do I need some other sort of Multidimensional array ?

Help appreciated

Thanks.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top