Пример #1
0
 private void btnDeleteAccount_Click(object sender, EventArgs e)
 {
     try
     {
         string        connectionString = "Data Source=.;Initial Catalog = ConnectDemo_db ;Integrated Security=true;"; //  connection string
         SqlConnection connection       = new SqlConnection(connectionString);                                         //make a connection with the provided connection string
         SqlCommand    command          = new SqlCommand("DELETE FROM Login WHERE Password="******";", connection);
         connection.Open();
         command.ExecuteNonQuery();
         connection.Close();
         MessageBox.Show("records deleted successfully");
     }
     catch (Exception exp)
     {
         MessageBox.Show(exp.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     frL = new frmLogin();
     this.Hide();
     frL.Show();
 }
Пример #2
0
 private void btnLogin_Click(object sender, EventArgs e)
 {
     this.Hide();
     frL.Show();
 }
Пример #3
0
 private void labelLogout_Click(object sender, EventArgs e)
 {
     this.Hide();
     frmL = new frmLogin();
     frmL.Show();
 }