why this code is not working ….
I want to binding the combo box with names coming from database table like this
private void getcategories()
{
var category = (from categories in tgs.categories
select categories.category_Name).ToList();
categoryCombobox.DataSource = category;
}
private void categoryCombobox_SelectedIndexChanged(object sender, EventArgs e)
{
getcategories();
}
am i doing any thing wrong for binding the details to combobox
any suggestions pls that would be helpful to me
edit – just as a small general criticism, your method is named poorly. I would do something more like: