private void button2_Click(object sender, EventArgs e) //view schedule button { student_schedule HA = new student_schedule(student); HA.RefToLastForm = this; this.Visible = false; HA.Show(); this.Hide(); }
private void pictureBox2_Click(object sender, EventArgs e) // continue { String ID = textBox1.Text; SqlConnection con = new SqlConnection(connect); String query = "Select * from Students where ID = '" + textBox1.Text.Trim() + "'"; SqlDataAdapter sda = new SqlDataAdapter(query, con); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count == 0) { MessageBox.Show("No ID exist in the collage"); } else { Student student = new Student(dt.Rows[0][1].ToString(), dt.Rows[0][0].ToString(), "0", dt.Rows[0][2].ToString(), dt.Rows[0][3].ToString(), (bool)dt.Rows[0][4]); student_schedule HA = new student_schedule(student); HA.RefToLastForm = this; this.Visible = false; HA.Show(); } }