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 STUDENT SET F_NAME='" + txtfname.Text + "',L_NAME='" + txtlname.Text + "',ADDRESS='" + txtadd.Text + "',PHONE_NO='" + txtphone.Text + "',PROGRAM='" + txtprog.Text + "',SECOND_NAME='" + txtsname.Text + "' WHERE STU_ID ='" + STU_ID + "'";
            SqlCommand ade   = new SqlCommand(query, con);

            ade.ExecuteNonQuery();
            {
                MessageBox.Show("student updation is done succesfully", "congratulation", MessageBoxButtons.OK, MessageBoxIcon.None);
                this.Hide();

                view_studentscs stu = new view_studentscs();
                stu.Show();
            }
        }
        private void button2_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 STUDENT  WHERE STUDENT.STU_ID='" + STU_ID + "'";
            SqlCommand ade   = new SqlCommand(query, con);

            ade.ExecuteNonQuery();
            {
                MessageBox.Show("deletion in student has been done succesfully", "Congratulation");

                this.Hide();
                view_studentscs sa = new view_studentscs();
                sa.Show();
            }
        }
示例#3
0
        private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            view_studentscs v = new view_studentscs();

            v.Show();
        }