Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
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.
Posted 18-Nov-12 3:28am
Sergey Alexandrovich Kryukov at 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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I resolve using dictionary with integer as ID reference.
Thank a lot for suggestion.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 458
1 OriginalGriff 384
2 George Jonsson 233
3 Animesh Datta 130
4 Shemeemsha RA 128
0 OriginalGriff 6,179
1 Sergey Alexandrovich Kryukov 5,616
2 CPallini 4,770
3 George Jonsson 3,400
4 Gihan Liyanage 2,522

Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100