F
Frank Rocco
Hello,
I have a DropDownList that I populate from an odbc datasource in code.
When I bring up the form for editing, how do I select the value in the
DropDownList based on a value stored in the database?
I tried:
lb1.SelectedItem.Text = dr["field"];
lb1.SelectedItem.Value = dr["field"];
Questions:
1. What happens if the item store in the database is no longer in the
dropdownlist box?
2. How can I sync two dropdownlist boxes?
When dropdownlist1 is selected, I fill dropdownlist2 when values from a
database based on the selected value in dropdownlist1.
When I bring the form up to edit a record, I want to select the value in
dropdownlist2 that matches the value in the database. This is not working
for me. The events are firing and the dropdownlists are filled, but the
value is not selected in the database.
Hope I explained this ok.
Thanks
Frank
using c#
I have a DropDownList that I populate from an odbc datasource in code.
When I bring up the form for editing, how do I select the value in the
DropDownList based on a value stored in the database?
I tried:
lb1.SelectedItem.Text = dr["field"];
lb1.SelectedItem.Value = dr["field"];
Questions:
1. What happens if the item store in the database is no longer in the
dropdownlist box?
2. How can I sync two dropdownlist boxes?
When dropdownlist1 is selected, I fill dropdownlist2 when values from a
database based on the selected value in dropdownlist1.
When I bring the form up to edit a record, I want to select the value in
dropdownlist2 that matches the value in the database. This is not working
for me. The events are firing and the dropdownlists are filled, but the
value is not selected in the database.
Hope I explained this ok.
Thanks
Frank
using c#