private void button1_Click(object sender, EventArgs e) { this.Hide(); Form13 obj = new Form13(); obj.Show(); }
private void BTNLOGIN_Click(object sender, EventArgs e) { try { NpgsqlConnection conn = new NpgsqlConnection(connstring); NpgsqlCommand SelectCommand = new NpgsqlCommand("SELECT * from officer WHERE officer_id='" + this.textBox1.Text + "' AND oname='" + this.textBox2.Text + "'", conn); conn.Open(); NpgsqlDataReader myReader = SelectCommand.ExecuteReader(); int count = 0; while (myReader.Read()) { count = count + 1; } if (count == 1) { conn.Close(); MessageBox.Show("Logging in.. Press OK."); this.Hide(); Form13 obj = new Form13(); obj.Show(); } else { conn.Close(); label3.Show(); } } catch (Exception ex) { MessageBox.Show("Some error occurred :" + ex); } }
/* private void btnBack_Click(object sender, EventArgs e) * { * this.Hide(); * Form13 obj = new Form13(); * obj.Show(); * }*/ private void btnBack2_Click(object sender, EventArgs e) { this.Hide(); Form13 obj1 = new Form13(); obj1.Show(); }