1: DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByValue(value); 或者:
DropDownList1.SelectedIndex = DropDownList1.Items.IndexOf(DropDownList1.Items.FindByText(text);
(适用于:通过数据库中DropDownList 的键(比如说为 4 )找到它所对应的值,并且显示出值来.)
2: Convert.ToInt32(this.DropDownList1.SelectedItem.Value)
(通过选择DropDownList 的值,将其相应的键(对应的索引)插入数据库中)
注意设置DropDownList 的键和值..............