public ViewJobs() { InitializeComponent(); SQLConnections sqlConnection = new SQLConnections(); List <string> items = new List <string>(); items = sqlConnection.FillComboBoxFromDatabase("SELECT CompanyName FROM Jobs ORDER BY CompanyID DESC"); lbDisplayJobs.ItemsSource = items; }
public void boxState_Loaded(object sender, RoutedEventArgs e) { SQLConnections sqlConnection = new SQLConnections(); var comboBox = boxState as ComboBox; states = sqlConnection.FillComboBoxFromDatabase("SELECT State FROM [dbo].[States]"); comboBox.ItemsSource = states; }
private void LocationBox_Loaded(object sender, EventArgs e) { SQLConnections sqlConnection = new SQLConnections(); var comboBox = sender as ComboBox; List <string> positions = new List <string>(); positions = sqlConnection.FillComboBoxFromDatabase("SELECT City FROM [dbo].[Location]"); positions.Add("Add Location"); comboBox.ItemsSource = positions; }