hai, i have a problem below this
protected void Button1_Click(object sender, EventArgs e)
{
int a = 0;
SqlConnection con = new SqlConnection("initial catalog=rajitha;data source=sys01;user id=sa");
con.Open();
// SqlDataReader dr =null;
SqlCommand cmd=new SqlCommand();
cmd.CommandType = System.Data.CommandType.Text;
cmd.Connection = con;
cmd.CommandText ="select Emailid,password from tb_registration where Emailid='"+TextBox1.Text+"' and password='"+TextBox2.Text+"'";
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
Server.Transfer("Default2.aspx");
}
else
{
Console.WriteLine("you have entered incorrect username,password");
a = a + 1;
}
if (a > 3)
{
Server.Transfer("Default5.aspx");
}
// Server.Transfer("Default2.aspx");
con.Close();
}
this code is for displaying captcha image but i didn't get captcha image when i entered incorrect uname,password.captcha image in default.aspx page and also
i didn't get any error message when i entered incorrect data in textbox comparing with database table.is there any wrong in coding .give reply with relevant information which may help to correct my problem.
Best regards,
Webmaster
http://www.dotnetfunda.com