private void Button1_Click(object sender, EventArgs e) { this.Hide(); LogInForm mark = new LogInForm(); mark.Show(); }
private void Button3_Click(object sender, EventArgs e) { { DialogResult dialog = MessageBox.Show("Do you want to Log Out?", "LOG OUT", MessageBoxButtons.YesNo); if (dialog == DialogResult.Yes) { this.Hide(); LogInForm ss = new LogInForm(); ss.Show(); } else if (dialog == DialogResult.No) { } } }
private void Button1_Click(object sender, EventArgs e) { try { SqlConnection cons = new SqlConnection(Properties.Settings.Default.conString); cons.Open(); SqlCommand command = new SqlCommand("INSERT INTO t_register (UserName, Password, reg_fname, reg_LName ) " + "VALUES ('" + UseName.Text.ToString() + "', '" + Pass.Text.ToString() + "','" + reg_fname.Text.ToString() + "'," + "'" + reg_last.Text.ToString() + "')", cons); command.ExecuteNonQuery(); MessageBox.Show("Success !!"); reset(); reg_fname.Focus(); this.Hide(); LogInForm mark = new LogInForm(); mark.Show(); } catch (Exception) { MessageBox.Show("Invalid UserName"); reset(); } }