472,992 Members | 3,332 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 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 1029

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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.