Display automatically corresponding data?

Posted by Mandlaa under ASP.NET on 3/8/2013 | Points: 10 | Views : 6667 | Status : [Member] | Replies : 4
I am running the project immoderately asking userid and pwd AFTER i am enter the details its checking backed database it's correct disply
that corresponding some another page,it's wrong display error msg.
My question is i am running the first time asking login details ok,I am running second time not asking again login details automatically display
that corresponding page,
can you give me one simple example on this plz help me what concept is involved to do this?????




Responses

Posted by: Jayakumars on: 3/8/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

set your login details to your sessions after validate them and logged in them.

Mark as Answer if its helpful to you

Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mandlaa on: 3/8/2013 [Member] Starter | Points: 25

Up
0
Down
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

Posted by: Jayakumars on: 3/9/2013 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

if it is possible can u sent ur Full code for me.

Mark as Answer if its helpful to you

Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mandlaa on: 3/9/2013 [Member] Starter | Points: 25

Up
0
Down
It's not possible to send code through this website,I am sending you gmail id plz once check my code

Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response