Help with hashtable

G

glbdev

Can anyone tell me the easiest way to retrieve a hashtable stored as a
Session variable?

Using this code:
Hashtable oHashTable = new Hashtable();
oHashTable = Session["myhashtable"];

Causes the following error:
"Cannot implicitly convert type 'object' to
'System.Collections.Hashtable'"


Thanks,
Gary
 
G

glbdev

Yes. That's what I did wrong. Don't know how I missed that. Thanks
for the quick response!! --- Gary


John said:
Are you just missing a cast?

oHashTable = (Hashtable)Session["myhashtable"];


Can anyone tell me the easiest way to retrieve a hashtable stored as a
Session variable?

Using this code:
Hashtable oHashTable = new Hashtable();
oHashTable = Session["myhashtable"];

Causes the following error:
"Cannot implicitly convert type 'object' to
'System.Collections.Hashtable'"


Thanks,
Gary
 

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