redirect to specific page based on db value
<p>I have a form which is like the login form ,,, the idea is the user enter his first name and last name and I need to check if the gender is male it will redirect to a male.aspx and if the gender is female it will redirect to female.aspx, and if firstname and lastname are wrong or not match or not exist he will go back to the same form again.</p>

<p>I did the main code but I don’t know how to check gender to redirect to the page</p>

<p>Also I want to show the full name (First &amp; last name) in the next page.</p>

<p>Here is my code. Hope I get help.</p>

<pre><code>protected void log_Click(object sender, EventArgs e)
{
    SqlDataSource sds = new SqlDataSource();
    sds.ConnectionString = ConfigurationManager.ConnectionStrings["myDbConnectionString1"].ToString();
    sds.SelectParameters.Add("firstname", TypeCode.String, this.firstname.Text);
    sds.SelectParameters.Add("lastname", TypeCode.String, this.lastname.Text);
    sds.SelectCommand = "SELECT * FROM [myTb] WHERE [firstname] = @firstname AND [lastname] = @lastname";
    DataView dv = (DataView)sds.Select(DataSourceSelectArguments.Empty);
    if (dv.Count == 0)
    {
        this.lblmsg.Text = "Invalid firstname and lastname!";
        return;
    }
    else
    {
        Response.Redirect("home.aspx");
    }
}
</code></pre>
