private void pictureBox4_Click(object sender, EventArgs e) { this.Hide(); Teacher_s_Page f1 = new Teacher_s_Page(); f1.Show(); }
private void label3_Click(object sender, EventArgs e) { connection.Open(); try { OleDbCommand command = new OleDbCommand(); command.Connection = connection; command.CommandText = "select * from Table1 where Email='" + alphaBlendTextBox1.Text + "'and Pass='******'"; OleDbDataReader reader = command.ExecuteReader(); int c = 0; while (reader.Read()) { c = c + 1; } if (c == 1) { MessageBox.Show("Username and Password are Correct"); this.Hide(); Teacher_s_Page f1 = new Teacher_s_Page(); f1.Show(); } else if (c > 1) { MessageBox.Show("Too Many Username of this"); } else { MessageBox.Show("Username and Password is not Correct"); } connection.Close(); } catch (Exception ex) { MessageBox.Show("Error" + ex); connection.Close(); } }