Exemplo n.º 1
0
        private void btn_SignIn_Click(object sender, EventArgs e)
        {
            //SqlConnection connectionString = new SqlConnection(@"Data Source=.;Initial Catalog=MovieHub;Integrated Security=True");
            string query = "SELECT * FROM login WHERE username = '******' AND password = '******'";

            adapter = new SqlDataAdapter(query, connectionString);
            DataTable dataTable = new DataTable();

            adapter.Fill(dataTable);

            if (dataTable.Rows.Count == 1)
            {
                Homepage Homepage = new Homepage();
                this.Hide();
                Homepage.Show();
            }
            else
            {
                MessageBox.Show("Invalid email or password");
            }
        }