I am creating a simple login function using an objectdatasource.
How can I check how many rows are selected after I run the query?
here is my dataobject
Code:
[DataObject(true)]
public static class MembershipDB
{
    [DataObjectMethod(DataObjectMethodType.Select)]
	public static IEnumerable CheckMembership(string username, string password)
	{
        SqlConnection con = new SqlConnection(ConnectionString.GetConnectionString());
        string sel = "SELECT * from Membership WHERE Membership.UserName = @ username AND Membership.Password=@password";
        SqlCommand cmd = new SqlCommand(sel, con);
        cmd.Parameters.AddWithValue("userName", username);
        cmd.Parameters.AddWithValue("password", password);
        con.Open();
        SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
        return dr;
		
     }
}
and here is where I call the selectmethod on a btn click
Code:
protected void BTNLogin_Click(object sender, EventArgs e)
    {
        ObjectDataSource1.Select();

    }
I just need to make sure the username and password that is sent is in the database, so how do i see if the rows affected = 0?
Thanks!
oh my object datasource is bound the this dataobject with the parameters with values set to textboxes on the form