daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void btn_cadastrar_Click(object sender, EventArgs e)
  2.     {
  3.         sqlcon.Open();
  4.         string sql = "SELECT COUNT(*) FROM userDB";
  5.         SqlCommand cmd = new SqlCommand(sql, sqlcon);
  6.         Int32 count = Convert.ToInt32(cmd.ExecuteScalar());
  7.         if (count == 5)
  8.         {
  9.             MessageBox.Show("São permitidos apenas 5 usuários", "Ficha de Anamnese - ERRO", MessageBoxButtons.OK, MessageBoxIcon.Information);
  10.         }
  11.         else
  12.         {
  13.             var newuser = new cadastrodeusuario();
  14.             newuser.Show();
  15.             this.Hide();
  16.         }
  17.         sqlcon.Close();
  18.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top