string strCon ="Data Source="";
string strSelect = "SELECT clientid FROM CONSUMER WHERE EmailId = @EmailId AND pwd = @pwd";
//string strSelect1 = "select ClientId from CLIENT where Email = @Email AND Password = @Password";
SqlConnection con = new SqlConnection(strCon);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = strSelect;
SqlParameter email = new SqlParameter("@EmailId", SqlDbType.VarChar, 50);
email.Value = TextBox1.Text.Trim().ToString();
cmd.Parameters.Add(email);
SqlParameter password = new SqlParameter("@pwd", SqlDbType.VarChar, 50);
password.Value = TextBox2.Text.Trim().ToString();
cmd.Parameters.Add(password);
con.Open();
Clientid = cmd.ExecuteScalar().ToString();
con.Close();
if (Clientid != null)
{
Session["Emailid"] = TextBox1.Text.ToString();
Session["clientid"] = Clientid;
Response.Redirect("http://cloudtags.com/demo/page2.html");
}
else
Label1.Text = "Incorrect EmailId or Password";
}
I am writting this code can you please look my code
Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator