Thursday, October 31, 2013

Login Page 2

protected void Button1_Click(object sender, EventArgs e)
    {
        SqlConnection cn = new
SqlConnection("uid=sa;password=123;Database=raj2;server=codem-PC");
        cn.Open();
        SqlCommand cmd = new SqlCommand("select*from hai where name='" +
TextBox1.Text + "' and id='" + TextBox2.Text + "'", cn);
        SqlDataReader dr = cmd.ExecuteReader();
        if (dr.HasRows)
        {
            Label3.Text = "ss";
        }
        else
        {
            Label3.Text = "ff";
        }
    }
}

No comments:

Post a Comment