473,320 Members | 1,881 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,320 software developers and data experts.

hashtable issue

Sam
Hi,

The following triggers this error :
Enumeration has either not started or has already finished.

(msg is a valid string)
CtrlStatus.Add(CInt(dtCtrl.Rows(iCntr).Item("Field ID")), msg)
Dim keys As IEnumerator = CtrlStatus.Keys.GetEnumerator()
Dim values As IEnumerator = CtrlStatus.Values.GetEnumerator()

my hashtable contains the right keys because when i type
CtrlStatus.contains(3) it works (3 is my only key). Besides .count
returns the correct number of elements.

So why do i get this message ?

thx

Nov 21 '05 #1
1 2763
Sam
ok i've found out...
I had to use keys.movenext and same for values

cheers

Nov 21 '05 #2

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

Similar topics

4
by: Greg Bacchus | last post by:
Hi, I'm just concerned about storing a large amount of items in a Hashtable. It seems to me that as the number of keys in the Hashtable increases, so does the chance of key clashes. Does anyone...
4
by: Vladimir C. | last post by:
Hashtable map = new Hashtable(); map = 10; map = 20; foreach(DictionaryEntry e in map) { e.Value = 100; Console.WriteLine("{0}: {1}", key, map); }
2
by: MFRASER | last post by:
Is there a limit to the size of a key for a Hashtable. I am adding items to a hashtable using a string for the key and it seems that when my key is 16 characters long the indexer does not work...
33
by: Ken | last post by:
I have a C# Program where multiple threads will operate on a same Hashtable. This Hashtable is synchronized by using Hashtable.Synchronized(myHashtable) method, so no further Lock statements are...
6
by: AD | last post by:
Hi All I am using a hashtable and trying to insert rows into sqlserver database. My hashtable has 2 rows. My code is as follows: Dim myEnumerator As IDictionaryEnumerator = vh.GetEnumerator()...
0
by: dotnet_vb_newbie | last post by:
I've developed a provider in VB which extends all textbox controls on a webform. The attributes for all the textbox objects are saved in a HashTable. I'm having a problem figuring out the right way...
2
by: juli jul | last post by:
Hello, I have an array (of objects) and I want that each entry in array will be a key in my hashtable.(not with foreach but in one action). Which method I should use for this? Thanks! *** Sent...
4
by: Joseph Bergevin | last post by:
Why can't I use an int for a key? Doing so evidently doesn't result in unique IDs being generated. I can convert the array into a delimited string, which works fine, but then I have a good deal of...
5
by: =?Utf-8?B?VG9t?= | last post by:
Cannot not seem to make any sense of the order that my key/values end up in when added to the Hashtable...ideally, I would like to be able to sort the keys/values...but not thinking it is possible....
1
by: chuckroc76 | last post by:
I am running into an issue with a HashTable where it isnt holding data in the order that I am adding it. I am pulling a SqlDataReader out of a table and looping through that to add the items to the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.