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(); }
private void btnLogin_Click(object sender, EventArgs e) { this.Hide(); frL.Show(); }
private void labelLogout_Click(object sender, EventArgs e) { this.Hide(); frmL = new frmLogin(); frmL.Show(); }