473,407 Members | 2,359 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,407 software developers and data experts.

Preloading hashtable with object references..

Hope someone can help with this. I have a form with about
400 objects on it - most of them fall into two types: radio buttons and text
boxes.

In the database, I have a table of values that, for each
item id (1, 2, 3...) there is an associated list of field
names (rbYes, rbNo, mskFirst, mskLast, mskQty). In my
form code, I have a LoadHashTable routine:

Dim Ctrl As Control
Dim SubCtrl As Control
For Each ctrl In Me.pnl01.controls
If Typeof Ctrl Is Panel Then
For Each SubCtrl In Ctrl.controls
gsHashTbl1.Add(Subctrl.Name, SubCtrl)
Next
End If
If (Typeof Ctrl Is C1.Win.C1Input.C1TextBox) Then
gsHashTbl2.Add(SubCtrl.Name, SubCtrl)
End If
Next

What I really need to do is pull the list of objects from
the database via an SP and then pre-load my hashtable
with object name and object type so I can reference them
dynamically in my FindControl subroutine - it's too much
of a hit to load this each and every time a user loads
this form.

My hashtable is declared as a global variable and I
think I should be able to do this, but I don't know how
to translate my LoadHashTable sub into something public.
The reason why is that I would not be iterating through
the pnl01 controls but through a datareader data set from
the database.

I tried several things, none of which worked. What I want
to do is this.

Dim rb As RadioButton
Tim tb As TextBox

For each row in datareader
If DataReader.Value(1) like "%rb%" THen
gsHashTable.Add(CtrlName, rb)
Else
gsHashTable.Add(CtrlName, tb)
End If
Next

What is it I'm missing here? TIA for any/all help
Jul 21 '05 #1
0 1046

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

Similar topics

3
by: Manish Jain | last post by:
Platform: C# (Windows Application)/XP/Framework 1.1 ----------------------------------------------------------- Hi I am doing some performance checks, I am using a hashtable that I suspect is...
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); }
3
by: MioTheGreat | last post by:
I know how to take a single hashtable, and then use a binaryformatter and a filestream to dump it to a file, but I need to serialize and deserialize a hashtable inside a class. I've been trying...
2
by: Noozer | last post by:
Code sample: dim hash as Hashtable 'Declare Hashtable .... hash.add (picOne.image, "picture") 'Error here picOne is a picturebox added to the form at design time with a GIF image applied....
7
by: J L | last post by:
I have defined a structure private structure FieldInfo dim FieldName as string dim OrdinalPostioin as Integer dim DataType as Type dim Size as Integer end structure I read this information...
0
by: W Hoover | last post by:
Hope someone can help with this. I have a form with about 400 objects on it - most of them fall into two types: radio buttons and text boxes. In the database, I have a table of values that, for...
2
by: Ray Cassick \(Home\) | last post by:
I have a hashtable in a class that contains key (strings) value (integers, strings, longs, etc...) data pairs. I want to move the data to another (different) class instance for processing. ...
10
by: chrisben | last post by:
Hi, Here is the scenario. I have a list of IDs and there are multiple threads trying to add/remove/read from this list. I can do in C# 1. create Hashtable hList = Hashtable.Synchronized(new...
7
by: Keith Hughitt | last post by:
Hi all, I am having trouble preloading images in a javascript application, and was wondering if anyone had any suggestions. Basically I have a bunch of images stored in a database as BLOBs. At...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.