473,721 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sorting a hashtable - please help!!

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.Collecti ons.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(Hashtab le 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.Collecti ons.ArrayList"

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

Thanking you,
Oct 16 '08 #1
1 1183
This is a duplicate; see my reply to your earlier post.
Oct 16 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: yee young han | last post by:
I need a fast data structure and algorithm like below condition. (1) this data structure contain only 10,000 data entry. (2) data structure's one entry is like below typedef struct _DataEntry_ { char szInput; char szOutput; int iSum;
by: wei | last post by:
how to get value by key in a hashtable? help: how to convert the piece of VB code to c#? If TypeOf pMap.SpatialReference Is IProjectedCoordinateSystem thank you!
by: VMI | last post by:
How can I sort a table column correctly when the table has values like "0", "A1", "AA-1", "B21", "3C", 4-32A", "1", "11-1", 2-A", etc... The table will then be loaded to a grid and that's when it'll have to sort correctly (when clicking on the col. header). Windows Explorer (in XP) seems to do this correctly when I sort files with these names. In the column, I tried padding all values with 0's and the sorting improved but it still...
by: vertigo | last post by:
Hello I defined: Hashtable chan1 = new Hashtable(new CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture), new InvariantComparer()); where: public class InvariantComparer : IComparer {
by: Aric Levin | last post by:
I have a Dataset that I read from SQL Server. The dataset can contain more items that I want to display. When I try to resort the dataset it doesn't sort. Here is the Syntax. I am not sure what the problem is: DataSet oDS = (DataSet)Cache; Sort = Session; // Removes All Sorting Signs
by: Fred Morrison | last post by:
Do you know of a way to load a hash table with random key/value pairs (e.g., 2/"Two",1/"One",3/"Three") and then iterate through the entries in "sorted" (key sequence) order (1/"One",2/"Two",3/"Three")? The following just returns them in the order they were loaded: Dim hshPrimaryKeyInfo as New Hashtable <snip code to Add entries to hash table> For Each hshEntry As DictionaryEntry In hshPrimaryKeyInfo
by: Ambica Jain | last post by:
Hi, I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. However, i need to rebind my datatable to reflect the changes in grid. And with rebinding, sorting image (little triangle on the column header) goes away. I need to show sorting image as well custom sorting. Please help. Thanks
by: rehet | last post by:
hye.. i really need ur guys help.. im stuck.. i want to count the word freq and print them according to the word length.. > the longest be output first.. ouh.. and my input must be alphabet or alhabet+numeric only.. here what i did so far.. #include <iostream> #include <string> #include <map> using namespace std; class Cmp : public std::binary_function<std::string,std::string,bool> {
by: NagarajanS | last post by:
Hi, i need one help in HashTable. see the below example /* * HashTableTest.java * * Created on October 20, 2007, 12:48 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */
by: almurph | last post by:
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****
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.