xaml:
<ComboBox SelectionChanged="status_SelectionChanged" Height="23" Name="status" ItemsSource="{Binding}" Width="120">
</ComboBox>
データベースのアイテムをコンボボックスのItemsSourceとして追加するにはどうすればよいですか?
MySqlCommand status_db = new MySqlCommand("select name from request_status", conn);
それで:
List<string> combolist = new List<string>();
MySqlDataReader reader = status_db.ExecuteReader();
while (reader.Read())
{
combolist.Add((string)reader);
}
しかし間違っています...