Ejemplo n.º 1
0
        public void FillDatabaseLookupEdit()
        {
            if (serverLookUpEdit.EditValue != null)
            {
                string    connectionString = CreateConnectionString();
                ArrayList dataBases        = null;
                if (string.IsNullOrEmpty(connectionString))
                {
                    return;
                }
                else
                {
                    dataBases = DALUtils.GetDatabases(connectionString);
                }

                if (dataBases == null)
                {
                    return;
                }
                dataBaseLookUpEdit.Properties.DataSource = dataBases;
                dataBaseLookUpEdit.Properties.ShowHeader = false;
                dataBaseLookUpEdit.Enabled         = (dataBases.Count > 0);
                testConnectionSimpleButton.Enabled = (dataBaseLookUpEdit.Enabled);
            }
        }
Ejemplo n.º 2
0
        private void testConnectionSimpleButton_Click(System.Object sender, EventArgs e)
        {
            if (dataBaseLookUpEdit.EditValue == null)
            {
                MessageBox.Show("Select a database before testing the connection.", "Error Encountered", MessageBoxButtons.OK);
                return;
            }

            bool success = DALUtils.TestConnection(CreateFullConnectionString());

            if (success)
            {
                MessageBox.Show("Test Succeeded", "Test Connection", MessageBoxButtons.OK);
            }
            else
            {
                MessageBox.Show("Test Failed", "Test Connection", MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 3
0
 private void serversBackgroundWorker_DoWork(System.Object sender, System.ComponentModel.DoWorkEventArgs e)
 {
     m_Servers = DALUtils.GetSQLServers();
 }