string SqlConnect = System.Configuration.ConfigurationManager.ConnectionStrings["Connect"].ConnectionString;
SqlConnection Sqlconn = new SqlConnection(SqlConnect);
SqlCommand sqlcomm = new SqlCommand("select email,userpassword from signup where email='" + TextBox1.Text + "' and userpassword='" + TextBox2.Text + "'",Sqlconn);
Sqlconn.Open();
SqlDataReader dr = sqlcomm.ExecuteReader();
if (dr.HasRows)
{
Session["email"] = TextBox1.Text;
dr.Close();
Sqlconn.Close();
Label1.Text = "Email-ID or Password you entered Is Valid !";
}
else
{
Label1.Text = "Email-ID or Password you entered do not match !";
Label1.ForeColor = System.Drawing.Color.DarkGreen;
}