Typically I get a DictionaryEntry from a foreach when walking a Hashtable.
My impression is that the foreach returns one item of the hash.
One of my commonly used functions received takes a DictionaryEntry as a
parameter.
In several instances I dont want to recreate a foreach item.
but this code to create the dictionaryEntry did not work: eg:
Hashtable hTableProcedure Tables = new Hashtable();
hTableProcedure Tables.Add("F", "cheese");
DictionaryEntry dObj = new DictionaryEntry ();
dObj = (DictionaryEntr y)hTableProcedu reTables["F"];
// FAILS...Specifi ed cast is not valid.
Why ? & what should I do ?
--
Andrew
My impression is that the foreach returns one item of the hash.
One of my commonly used functions received takes a DictionaryEntry as a
parameter.
In several instances I dont want to recreate a foreach item.
but this code to create the dictionaryEntry did not work: eg:
Hashtable hTableProcedure Tables = new Hashtable();
hTableProcedure Tables.Add("F", "cheese");
DictionaryEntry dObj = new DictionaryEntry ();
dObj = (DictionaryEntr y)hTableProcedu reTables["F"];
// FAILS...Specifi ed cast is not valid.
Why ? & what should I do ?
--
Andrew
Comment