Try this

npsenthil kumar replied to shreya verma at 12-May-08 01:35

Hi,

Do the changes that marked in red in your code


protected void btnLogin_Click(object sender, EventArgs e)

{

string constr = ConfigurationManager.ConnectionStrings["ConStr"].ToString();

SqlConnection con = new SqlConnection(constr);

con.Open();

SqlCommand cmd = new SqlCommand("Usp_CheckLogin", con);

cmd.CommandType = CommandType.StoredProcedure;

cmd.Parameters.AddWithValue("@userid", txtUserID.Text);

cmd.Parameters.AddWithValue("@password", txtPassword.Text);

cmd.Parameters.AddWithValue("@role", DDRole12.SelectedValue);

SqlDataReader sdr = cmd.ExecuteReader();

if (sdr.Read())

{

if  (DDRole12.SelectedValue == "User")

{

Response.Redirect("EmployeeProfile.aspx?empid=" + txtUserID.Text);

}else

{

Response.Redirect("EmployeeView.aspx?empid=" + txtUserID.Text);

}

}

else

{

Response.Write("Your Login Unsuccessful");

}

sdr.Close();

con.Close();

}




Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  Login Prob... - shreya verma  12-May-08 12:53 12:53:53 AM
      check User variable's value... - Vasanthakumar D  12-May-08 12:58 12:58:48 AM
          See my old code... - shreya verma  12-May-08 01:08 1:08:48 AM
              Check this... - santhosh kapa  12-May-08 01:14 1:14:42 AM
              use this code... - Vasanthakumar D  12-May-08 01:19 1:19:35 AM
                  Thanks - shreya verma  12-May-08 01:22 1:22:59 AM
                  Thanks - shreya verma  12-May-08 01:23 1:23:00 AM
              Try this - npsenthil kumar  12-May-08 01:35 1:35:15 AM
      reply - Danish Shaikh  12-May-08 01:00 1:00:54 AM
      Re: Login problem - Chirag Bhavsar  12-May-08 01:08 1:08:42 AM
      See This - Sanjay Verma  12-May-08 01:40 1:40:10 AM
      Re: - chakradhar koturu  12-May-08 01:41 1:41:36 AM
View Posts