473,402 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

cast sortedlist value as hashtable

i have a sortedlist.
its values are hashtables.

i need to access one of these hashtables:

using option strict without a cast, i got a late binding error :

mysortedlist("key")

when i try to cast it:

directcast(mysortedlist("key"), "hashtable") or
ctype(mysortedlist("key"),"hashtable")

i get an error "type expected"

what is the correct way to perform the case? can anyone help?
thanks in advance!

Nov 21 '05 #1
2 1073

fizzy wrote:
i have a sortedlist.
its values are hashtables.

i need to access one of these hashtables:

using option strict without a cast, i got a late binding error :

mysortedlist("key")

when i try to cast it:

directcast(mysortedlist("key"), "hashtable") or
ctype(mysortedlist("key"),"hashtable")

i get an error "type expected"

what is the correct way to perform the case? can anyone help?


You are almost there!

directcast(mysortedlist("key"), HashTable)

No quotes :)

--
Larry Lard
Replies to group please

Nov 21 '05 #2
cannot believe i missed that one!! i'm so stupid - but thanks for not
saying so larry :)

Nov 21 '05 #3

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

Similar topics

3
by: DraguVaso | last post by:
Hi, I read somewhere that it would be better to use a HashTable or a SortedList instead of a collection in VB.NET. Is this true and why is this better? Is it faster or more performant or ...? ...
1
by: gerrod | last post by:
Hi - Does anyone know a way to created a SortedList (in the System.Collections namespace) that will sort on VALUES instead of KEYS... ? The scenario is this - I have a SortedList containing...
5
by: Daniel Gackle | last post by:
I'm getting a strange ArgumentNullException after deserializing a SortedList. Haven't seen this discussed in the newsgroups, but it looks like a bug - unless I missed something obvious? I've...
3
by: Kiran | last post by:
Hi, I need to store two columns of values in an object after getting the same from a dataset\similar object. 1. I need to sort this data at one place, so I use sortedlist here. 2. In...
2
by: andrewcw | last post by:
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...
2
by: Georg | last post by:
Hi, I would like to use a SortedList collection to store numeric data items with a key (numeric location). When I have a key which is not stored in the SortedList and which should not be stored...
4
by: SHEBERT | last post by:
Here is an example of a SortedList that works as a datasource to the ComboBox and a generic SortedList<that does not works as a datasource to the ComboBox. Why? If I use List and generic List<>,...
1
by: raylopez99 | last post by:
I seem to get name collision between the Generic collection SortedList and C++.NET Framework collection SortedList. How to resolve? Here are the libraries that seem to clash:...
2
by: =?Utf-8?B?VGVk?= | last post by:
I have been asked to change an existing program which Implemented a Collection Class The current class had what is below (its just a summary of the code) Public Class FieldList Implements...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
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...
0
agi2029
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,...

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.