Help with hashtable

  • Thread starter Thread starter glbdev
  • Start date Start date
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
 
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
 
Back
Top