private void BtnLogin_Click(object sender, EventArgs e) { if (txtboxPass.Text.Trim() == "" || txtboxUser.Text.Trim() == "") { MessageBox.Show("Please enter Username and Password"); return; } SQLQuery sqlFunction = new SQLQuery(); try { sqlFunction.ValidateLogin(txtboxUser.Text, txtboxPass.Text); Global.username = txtboxUser.Text; this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); return; } }