private void button1_Click(object sender, EventArgs e) { Hide(); BoardAdmin board = new BoardAdmin(); board.ShowDialog(); Close(); }
private void button1_Click(object sender, EventArgs e) { GetConnection(); DataGridViewRow dr = dataGridView2.SelectedRows[0]; string id = dr.Cells[0].Value.ToString(); string boardname = dr.Cells[1].Value.ToString(); string content = dr.Cells[3].Value.ToString(); string sql = "delete from board where id='" + id + "' and boardname='" + boardname + "' and content='" + content + "'"; MySqlCommand cmd = new MySqlCommand(sql, conn); conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); MessageBox.Show("게시글이 삭제되었습니다."); Hide(); BoardAdmin board = new BoardAdmin(); board.ShowDialog(); Close(); }