private void TableComboBox_DropDownOpened(object sender, EventArgs e) { var helper = new SqlDbHelper(ConnectionStringTextBox.Text); var provider = new SqlServerProvider(helper); var tables = provider.GetTableSchemas(); TableComboBox.ItemsSource = tables.OrderBy(x => x.Name); }
private void TableComboBox_DropDownOpened(object sender, EventArgs e) { if (_tables != null && _tables.Count() > 0 && !String.IsNullOrEmpty(_connectionString) && !String.IsNullOrEmpty(ConnectionStringTextBox.Text) && _connectionString.Equals(ConnectionStringTextBox.Text)) { TableComboBox.ItemsSource = _tables; return; } var helper = new SqlDbHelper(ConnectionStringTextBox.Text); var provider = new SqlServerProvider(helper); var tables = provider.GetTableSchemas(); _tables = tables.OrderBy(x => x.Name); TableComboBox.ItemsSource = _tables; }