Hello, I am trying to populate aListBox witha field(RName) from a LINQ to SQL database (DataClasses1.dbml),table(RTables) filteredby field RType. The RType is being selected by the user from ComboBox1 which is databound to that field. ComboBox1 displaysthe dataproperly but the ListBox displays nothing. This is the code but I am not sure where to put it or why it doesn't work. I've tried to put it in the ComboBox1_SelectedIndexChanged, the ListBox event,and the Form Load event. Thanks for looking. Any help is appreciated.
| DimdbAsNewDataClasses1DataContext |
|
| DimRByType=FromrpIndb.RTablesWhererp.RType=(ComboBox1.Text)Selectrp.RName |
|
| ForEachrpInRByType |
| ListBox1.Items.Add(RByType) |
| Next |