Exemplo n.º 1
0
        private void PopulateDropDown()
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                SqlConnectionStringBuilder connectionBuilder;


                connectionBuilder = new SqlConnectionStringBuilder( );

                connectionBuilder.DataSource         = serverNameCoboBox.Text;
                connectionBuilder.IntegratedSecurity = windowsAuthenticationRadioButton.Checked;
                connectionBuilder.UserID             = userNameTextBox.Text;
                connectionBuilder.Password           = passwordTextBox.Text;

                serverDatabaseComboBox.DataSource = SqlUtilities.GetDatabaseList(connectionBuilder);
            }
            catch (Exception exp)
            {
                serverDatabaseComboBox.DataSource = null;

                serverDatabaseComboBox.Items.Clear( );

                Messager.ShowError(this, exp);

                System.Diagnostics.Debug.Assert(false);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }