Sorting a hashtable - please help!!

A

almurph

H ieveryone,

Can you help me please? I am trying to sort a hashtable but get the
error: "Cannot implicity convert type void to
System.Collections.ArrayList"

I am doing the following:


****BEGIN CODE****


public ArrayList SomeMethod()
{
Hashtable myHT = new HashTable();

ArrayList keys = GetKeys (HT);

return keys.sort();
}


//Return an arraylist of Hashtable keys
public ArrayList GetKeys(Hashtable table)
{
return (new ArrayList(table.Keys));
}


****END CODE****


However under the "keys.Sort()" method call I get the error: "Cannot
implicity convert type void to System.Collections.ArrayList"

I'm stuck. Would greatly appreciate any comments/suggestions/
corrections that you may be able to offer.

Thanking you,
Al.
 

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