You have chosen the wrong event in which to connect to the database - if the combo box is disabled then you can never change the selection so you can't connect to the database! It's a vicious circle.
Try making the connection in the Form Load event. Then set the ComboBox Enabled property to false if the connection fails
Edit after OP comments:
If I assume button1 is to connect to the database then something like this would work - I've highlighted the changes I've made
private void button1_Click(object sender, EventArgs e)
{
server = textBox1.Text;
databaseName = textBox2.Text;
userid = textBox3.Text;
password = textBox4.Text;
if (server == "" && databaseName == "" && userid == "" && password == "")
{
MessageBox.Show("Please fill in the database connection information completely");
}
else
{
if (OpenConnection(connection, server, databaseName, userid, password))
{
MessageBox.Show("Database connection succeeded");
comboBox1.Enabled = true;
}
else
{
MessageBox.Show("Database connection failed");
comboBox1.Enabled = false;
}
}
}
In the Form designer you can click on the combo box control and disable it from the Properties window there to ensure it is always disabled. Or you could use
private void Form1_Load(object sender, EventArgs e)
{
textBox4.PasswordChar = '*';
textBox8.PasswordChar = '*';
comboBox1.Enabled = false;
}
One final comment - I've had to guess that button1 is what you are using to connect to the database because you have left the default names on all of your controls (Form1, Button1, Button2, Button3, comboBox1). Get into the habit of giving your controls meaningful names as soon as you have added them to your form/canvas/page - it will make your life a lot easier without having to remember what each of the controls is.