maps

K

kelvin.koogan

I have a database table containing a sparse mapping from an integer to
a string. I retrieve this table into an OleDbDataReader. I'd then like
to copy the data into a map so I can quickly find the string
corresponding to an integer.

My initial thought is to use a std::map but this is causing all kinds
of problems converting between managed and unmanaged types.

Is std::map the right container or is there a better one in the .NET
class library?

If std::map is still the right container how can I convert from the
System::String returned by OleDbDataRead::GetString to something which
can go in a std::map, e.g. std::string and then back to a
System::String?

TIA,
KK
 
B

Ben Voigt [C++ MVP]

I have a database table containing a sparse mapping from an integer to
a string. I retrieve this table into an OleDbDataReader. I'd then like
to copy the data into a map so I can quickly find the string
corresponding to an integer.

My initial thought is to use a std::map but this is causing all kinds
of problems converting between managed and unmanaged types.

Is std::map the right container or is there a better one in the .NET
class library?

No, STL isn't usable for managed types until at least Orcas.
 

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

Top