protected void btnsubmit_Click(object sender, EventArgs e)
{
try
{
String qry = "select id from login Where (useremail='" + txtuser.Text + "' AND password='" + txtpasswd.Text + "') ";
SqlCommand cmd = new SqlCommand(qry, connect.getConnection());
cmd.Connection.Open();
SqlDataReader rd;
rd = cmd.ExecuteReader();
if (rd.Read())
{
Session["cid"] = rd[0].ToString();
cmd.Connection.Close();
Response.Redirect("Home.aspx");
}
else
{
Label5.Text = "Email Id And Password Dose Not Match...";
Label5.Visible = true;
txtuser.Focus();
cmd.Connection.Close();
}
}
catch (Exception ex)
{
//for Error reading only on page default.aspx
Session["err"] = ex.ToString();
Response.Redirect("default.aspx");
}
//finally
// {
// cmd.Connection.Close();
//}
}
Please Help me as early as possible