I want to make a login page with an Access database for a school project with asp.net. I dont have really experience with C# so im doing different tutorials.
protected void Login1_Click(object sender, EventArgs e)
{
    string connect = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=http://tmti-16.ict-lab.nl/database/ek2012.mdb";
    string query = "Select Count(*) From users Where username = ? And userpassword = ?";
    int result = 0;
    using (OleDbConnection conn = new OleDbConnection(connect))
    {
        using (OleDbCommand cmd = new OleDbCommand(query, conn))
        {
            cmd.Parameters.AddWithValue("", UserName.Text);
            cmd.Parameters.AddWithValue("", Password.Text);
            conn.Open();
            Session["User"] = UserName.Text;
            result = (int)cmd.ExecuteScalar();
        }
    }
    if (result > 0)
    {
        Response.Redirect("index.aspx");
    }
    else
    {
        Literal1.Text = "Invalid credentials";
    }
}
In Access I have the table 'users' with the 'username' and 'userpassword' rows.