private void button4_Click(object sender, EventArgs e) { Form AdminFunctions = new AdminFunctions(); AdminFunctions.Show(); Hide(); }
private void EnterSigninA_Click(object sender, EventArgs e) { string query; SqlConnection sqlConnection = new SqlConnection("Data Source=ABASSEM;Initial Catalog=FlightReservationSystem;Integrated Security=True"); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = sqlConnection; sqlConnection.Open(); query = sqlCommand.CommandText = "select * from admin where aname='" + textBox2.Text + "' and apass='******' "; SqlDataAdapter adapter = new SqlDataAdapter(query, sqlConnection); DataTable dtbl = new DataTable(); adapter.Fill(dtbl); if (dtbl.Rows.Count == 1) { Form AdminFunctions = new AdminFunctions(); AdminFunctions.Show(); Hide(); } else { MessageBox.Show("Invalid Username or Password"); } }