private void buttonUPDATE_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=DESKTOP-5QHHH7M;Initial Catalog=HOSTEL;Integrated Security=True");

            con.Open();
            string     query = "UPDATE stu_room SET room_id ='" + txtroomno.Text + "',stu_id ='" + txtSTUID.Text + "' where stu_room_id = '" + stu_room_id + "'";
            SqlCommand cmd   = new SqlCommand(query, con);

            cmd.ExecuteNonQuery();
            string     query1 = "UPDATE ROOM SET room_type = '" + TXTTYPE.Text + "',price = '" + TXTPRICE.Text + "' where ROOM_ID ='" + ROOM_ID + "'";
            SqlCommand CMD1   = new SqlCommand(query1, con);

            CMD1.ExecuteNonQuery();
            string     query2 = "UPDATE STUDENT SET F_NAME = '" + TXTNAME.Text + "' WHERE STU_ID = '" + STU_ID + "'";
            SqlCommand CMD2   = new SqlCommand(query2, con);

            CMD2.ExecuteNonQuery();
            {
                MessageBox.Show("Updation done succesfully");
                this.Hide();

                Rooms_not_occupied de = new Rooms_not_occupied();
                this.Show();
            }
        }
        private void buttonDELETE_Click(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection("Data Source=DESKTOP-5QHHH7M;Initial Catalog=HOSTEL;Integrated Security=True");

            con.Open();
            string     query = "delete from stu_room  WHERE stu_room.room_id='" + txtroomno.Text + "'";
            SqlCommand runq1 = new SqlCommand(query, con);

            runq1.ExecuteNonQuery();

            {
                MessageBox.Show("deletion  done Successifully");
                this.Hide();


                Rooms_not_occupied sa = new Rooms_not_occupied();
                sa.Show();
            }
        }
Example #3
0
        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Rooms_not_occupied r = new Rooms_not_occupied();

            r.Show();
        }
        private void rOOMOCCUPIEDToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Rooms_not_occupied da = new Rooms_not_occupied();

            da.Show();
        }