Example #1
0
        private void PopulateTablesAndSequences()
        {
            errorLabel.Text = string.Empty;
            tablesListBox.DataBindings.Clear();
            try
            {
                if (ownersComboBox.SelectedItem == null)
                {
                    return;
                }
                var tables = metadataReader.GetTables(ownersComboBox.SelectedItem.ToString());
                tablesListBox.Enabled = false;
                tablesListBox.Items.Clear();
                if (tables != null && tables.Any())
                {
                    tablesListBox.Items.AddRange(tables.ToArray());
                    tablesListBox.Enabled       = true;
                    tablesListBox.SelectedIndex = 0;
                }

                var sequences = metadataReader.GetSequences(ownersComboBox.SelectedItem.ToString());
                sequencesComboBox.Enabled = false;
                sequencesComboBox.Items.Clear();
                if (sequences != null && sequences.Any())
                {
                    sequencesComboBox.Items.AddRange(sequences.ToArray());
                    sequencesComboBox.Enabled       = true;
                    sequencesComboBox.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                errorLabel.Text = ex.Message;
            }
        }
Example #2
0
        private void PopulateTablesAndSequences()
        {
            try
            {
                toolStripStatusLabel1.Text = "Retrieving tables...";
                statusStrip1.Refresh();

                if (ownersComboBox.SelectedItem == null)
                {
                    tablesListBox.DataSource = new List <Table>();
                    return;
                }
                _tables = metadataReader.GetTables(ownersComboBox.SelectedItem.ToString());
                tablesListBox.Enabled       = false;
                TableFilterTextBox.Enabled  = false;
                tablesListBox.DataSource    = _tables;
                tablesListBox.DisplayMember = "Name";

                if (_tables != null && _tables.Any())
                {
                    tablesListBox.Enabled      = true;
                    TableFilterTextBox.Enabled = true;
                    tablesListBox.SelectedItem = _tables.FirstOrDefault();
                }

                var sequences = metadataReader.GetSequences(ownersComboBox.SelectedItem.ToString());
                sequencesComboBox.Enabled = false;
                sequencesComboBox.Items.Clear();
                if (sequences != null && sequences.Any())
                {
                    sequencesComboBox.Items.Add(""); // No sequence
                    sequencesComboBox.Items.AddRange(sequences.ToArray());
                    sequencesComboBox.Enabled       = true;
                    sequencesComboBox.SelectedIndex = 0;
                }

                toolStripStatusLabel1.Text = string.Empty;
                statusStrip1.Refresh();
            }
            catch (Exception ex)
            {
                toolStripStatusLabel1.Text = ex.Message;
            }
        }