private void login_Load(object sender, EventArgs e) { textBox1.Focus(); con_db atload = new con_db(); if (atload.OpenConnection()) { label3.ForeColor = Color.Blue; string codetail = atload.Getserverdetail(); label3.Text = "Connected to server at " + codetail; atload.CloseConnection(); } else { label3.ForeColor = Color.Red; label3.Text = "Connection to server Failed"; } }