private void button1_Click(object sender, EventArgs e) { this.Hide(); RegisterRoom rg = new RegisterRoom(); rg.Show(); }
private void button1_Click(object sender, EventArgs e) { string insertQuery = "TRUNCATE TABLE RegisterRoomTable;"; SqlCommand cmd = new SqlCommand(insertQuery, conn); conn.Open(); try { DialogResult ex = MessageBox.Show("Are you really really really sure???", "Warning", MessageBoxButtons.YesNo); if (ex == DialogResult.Yes) { if (cmd.ExecuteNonQuery() == 1) { MessageBox.Show("Data Inserted"); } else { MessageBox.Show("All Data Deleted."); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } conn.Close(); this.Dispose(); RegisterRoom rg = new RegisterRoom(); rg.Show(); }
private void button1_Click(object sender, EventArgs e) { string insertQuery = "TRUNCATE TABLE RegisterRoomTable;"; SqlCommand cmd = new SqlCommand(insertQuery, conn); conn.Open(); try { if (cmd.ExecuteNonQuery() == 1) { MessageBox.Show("Data Inserted"); } else { MessageBox.Show("All Data Deleted."); } } catch (Exception ex) { MessageBox.Show(ex.Message); } conn.Close(); this.Dispose(); RegisterRoom rg = new RegisterRoom(); rg.Show(); }