Beispiel #1
0
        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 UNIVERSITY SET  UNI_NAME='" + textBox1.Text + "', EMAIL='" + textBox3.Text + "',PHONE_NO='" + textBox4.Text + "',ADDRESS='" + textBox2.Text + "' where UNI_ID='" + UNI_ID + "'";
            SqlCommand runquery = new SqlCommand(query, con);

            runquery.ExecuteNonQuery();
            MessageBox.Show("successful");
            this.Close();
            var asha = new Form7();

            asha.Show();
        }
Beispiel #2
0
        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  UNIVERSITY   WHERE  UNIVERSITY.UNI_ID='" + UNI_ID + "'";
            SqlCommand runquery = new SqlCommand(query, con);

            runquery.ExecuteNonQuery();
            MessageBox.Show(" Deletion finished successfully");
            this.Close();
            var asha = new Form7();

            asha.Show();
        }
        private void vIEWUNIVERSITYToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var we = new Form7();

            we.Show();
        }