Пример #1
0
        private void cmdAddSource_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(this.cboDatabases.Text))
            {
                MessageBox.Show("Please provide a database name.");
                this.cboDatabases.BackColor = invalidColour;
                return;
            }
            else
            {
                source.Database             = this.cboDatabases.Text;
                this.cboDatabases.BackColor = validColour;
            }

            try
            {
                queryProvider.AddSource(source);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            MessageBox.Show("Source successfully added.");
        }