Ask the Expert

Generating classes like we did in VB6

I need to generate classes (for example, "employee") and collection classes (Employees collection of the employee class) in VB.NET as I could do in VB6. I should be able to use "for each" on the collection classes (for each employee in employees)

I could do this by using the sorted list collection, but the data is always sorted by the key (in this case I used employee ID.) I tried using the hashtable but it didn't work. Could you please let me know how to sort the data in the sorted list in a different manner? Or perhaps you know how to implement the same using a hashtable?

Take a look at the array list. It has a sort method allowing you to implement your own sort comparer so you can sort the list items in any order you would like. That should solve your problem right there.

This was first published in January 2005

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: