private void UpdateBtn_Click(object sender, EventArgs e)
        {
            this.Hide();
            UpdateTeacher UT = new UpdateTeacher(uid);

            UT.Show();
        }
Ejemplo n.º 2
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            con.Open();
            SqlCommand cmd = con.CreateCommand();

            cmd = new SqlCommand("Update teacher set address= (@add),tname =(@name) where tid = (@data)", con);

            cmd.Parameters.AddWithValue("@data", i);
            cmd.Parameters.AddWithValue("@add", textAddress.Text.ToString());
            cmd.Parameters.AddWithValue("@name", textName.Text.ToString());

            cmd.ExecuteNonQuery();

            MessageBox.Show("Updated!");
            this.Hide();
            UpdateTeacher asa = new UpdateTeacher(a);

            asa.Show();
        }