473,796 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change A Value In a HashTable?

I have a collection of objects in a hashtable.

The objects have a datamember that is empty.

I need to loop through the items in the hashtable and add data to the
datamember that is empty.

htShippingItems is the hashtable which contains a collection of
ShippingItems. Each shipping item has a datamember called Itemized that I
need to populate with a string.
-----------------------------------------------------------------
Sub MergeMultiples

Dim m As clsMultiple
Dim s As clsShippingItem
Dim str As String
For Each s In htShippingItems .Values
If s.Multi = "-1" Then
For Each m In htMultiples.Val ues
If m.Multi = s.ItemID Then
str &= m.ItemID & "," & m.Description & ","
End If
Next
str = str.TrimEnd("," )
s.Itemized = str

End If
str = ""
Next

End Sub
--------------------------------------------------------------------

Im obtaining the data I need from another hashtable which contains a
collection of Multiple Objects.

At the point of str = str.TrimEnd("," ) the str variable contains the desired
data and it gets assigned to s.Itemized.

But Afterwards if I try to access the Itemized member from the hashtable it
is null.
Thanks for any help
Slonocode

Nov 20 '05 #1
1 3025
Oops nevermind the code I posted actually works I had a logic error
elsewhere that was preventing me from seeing the data I wanted.


Nov 20 '05 #2

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

Similar topics

3
7419
by: oliver.wulff | last post by:
Does there exist a class similar to a hashtable which provides a key-value pair collection. The key and the value has to be a string?
2
3135
by: PABLO | last post by:
Hello I have a Hastable, which I need to order it by value and not by key. Regards
1
3115
by: Pavils Jurjans | last post by:
Hello, I am building custom hashtable class, and thinking about value retrieval issues. The thing is, that sometimes the hashtable value may contain value null. If someone is reading this value like this value = myHashtable; then, is the value of "myKey" key is null, then the result is the same, as
2
3338
by: BCM | last post by:
How do you reset a value for an existing key in a hashtable? I need to create a collection and compare the values with another collection: when certain parameters are met then I need to reset the value of certain elelments in the first collection. I would have thought that the Hashtable.Item property would do the trick, as MSDN defines it as "Gets or sets the value associated with the specified key". But the actual documentation is so...
7
20125
by: Dan | last post by:
I have the need to translate values back and forth. I have created a Hashtable to do this because I don't care about intrinsic order and I want it to be a fast as possible. My only concern is that I doubled the size of my Hashtable to accommodate translating both ways. Kind of like the following, but longer with more complicated data. Hashtable ht = new Hashtable(); ht.Add("x1", "y1"); ht.Add("x2", "y2"); ht.Add("y1", "x1");
3
8645
by: Oberon | last post by:
How do I deal with this? I am getting an error for each get in the Game class (see code below). In the simplified example below I have reduced this to just 3 fields, one which can be NULL. I have added 3 records to the table and ran the program but it fails with the error above. The application is supposed to create the hashtable of records as a static feature which will be permanently available to my application. To demonstrate that...
7
36823
by: ad | last post by:
I have a hash table like: Hashtable myHT = new Hashtable(); myHT.Add("First", "Hello"); myHT.Add("Second", "World"); myHT.Add("Third", "!"); We can use key to find value like: myHT -> "Hello" But how can use use value to find key?
23
11327
by: illegal.prime | last post by:
Hi all, is there a key value collection in .Net that maintains the ordering in which I add items. I'm finding that I'm creating a number of classes that contain a name and then some object. I would prefer just to use some collection that maintains the ordering in which I add things (like ArrayList), but that maps a key to a value. I thought NameValueCollection was the right one - but it doesn't guarantee ordering.
3
1542
by: Rich | last post by:
Hello, I populate a hashtable with recordID's in a "For i=0 to n" loop. Some recordID's are duplicate but for different rows (recordID is not a key field in this scenario). I use the value of "i" in the For loop as the key in the hashtable (which is actually the currencyManager counter). Originally, I was using the recordID as the key and "i" as the value. So if I user needed to go to recordID = 12345, I just retrieve the...
0
9685
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, 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...
0
9535
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,...
0
10465
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, 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...
1
10200
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9061
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, 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...
0
6800
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4127
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
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.