Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi to all,

this is problem, I create a VB.NET programs, where there are a AccessDB, from table A of this DB I create dynamically a textbox and for each textbox I create two combobox1, the fisrt one it's populated by table B, and until here all are ok, I obtain a form with a line for each record in table A, but now I want to populate the second combobox2 doing a sql query on table C using the value in textbox and combobox1, and here I don't know how to obtain value from dynamic controls.
The problem is that also then I want export each value of line in db or csv.
Can anyone help me please, or paste any example.

Thank a lot.
Augusto.
Posted
Comments
Sergey Alexandrovich Kryukov 18-Nov-12 11:34am    
What is the exact type of "TextBox" or "ComboBox"? There is a number of different controls under these names. Full names, please. And you always need to tag UI library you use.

And please don't forget to ask a question.
--SA

I resolve using dictionary with integer as ID reference.
Thank a lot for suggestion.
 
Share this answer
 
Your controls are part of the Controls collection of the form, but if you're creating them dynamiclaly, you're better off putting them in a collection so you have kept a reference to them and can refer to them from there. You can set their id in code, and look for it, or use a dictionary to map a value ( probably a string ) to each control you want to look for.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900