|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Changing text boxes contents interactivelyHi everyone,
In my windows form, I have a combo box that is bound to a column (child id) in an SQL database table. When a user select a child id from the combo box, I want two text boxes in the same form to show the first and last name of that particular child id that the user selected. What is the code for that? Thanks a lot. -- TS you have already set your datasource to your combo box
so onchange event I do not know how you populate your combo box but i do it as dim ds as new dataset ds = database get record call combobox1.displaymember = ds.tables(0).item("BLA") combobox1.valuemember = ds.tables(0).item("BLA#") combobox1.datasource = ds.tables(0) To get the values out dim dt as datatable dim datar as datarow dim dr as datarow() dt = combobox1.datasource.table(0) 'returns an array of rows dr = dt.select("Databasefield = " & combo1.selectedvalue ) for each datar in dr 'you will only have 1 datarow if your selecting on the primary key next Show quoteHide quote "TS" <T*@discussions.microsoft.com> wrote in message news:2377C3E0-0F08-4602-B6E6-41A107D500BD@microsoft.com... > Hi everyone, > In my windows form, I have a combo box that is bound to a column (child > id) > in an SQL database table. When a user select a child id from the combo > box, I > want two text boxes in the same form to show the first and last name of > that > particular child id that the user selected. What is the code for that? > > Thanks a lot. > > -- > TS
Translate C# to VB.net?
Splash window XmlTextReader not getting all Elements Combobox and DataSource "Add Reference" hosed--doesn't display the dialog in VS.NET PDF to Picturebox Newbie: substrings VB.net Datagrid Parent Row [ANN] April 12, 2005, "Visual Basic 2005 Language Enhancements" chat ComboBox data |
|||||||||||||||||||||||