|
Please dont double post, just put your error message on the same post as your question
When you type in localhost make sure you are not putting something like ip = , it should be servername = when you use localhost
|
|
|
|
|
Hi i am new for vs2005,
I have used login control in my Home.aspx page
With ref some site, i used the code,
But for me after login its not redirecting to next page.
Getting "Your login attempt was not successful. Please try again." Messgae only,
But my uid and pwd both are correct whats the probs?
This is my code:
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated=SiteLevelCustomAuthenticationMethod(Login1.UserName,Login1.Password);
e.Authenticated = Authenticated;
if (Authenticated == true)
{ Response.Redirect("Sam.aspx"); }
}
private bool SiteLevelCustomAuthenticationMethod(String UserName, String Password)
{
bool boolReturnValue = false;
String strConnection = "Server=(local);database=WorkOut;uid=sa;pwd=bumi;";
SqlConnection Connection = new SqlConnection(strConnection);
String strSql = "Select * From UserLogin";
SqlCommand SqlCmd = new SqlCommand(strSql, Connection);
SqlDataReader SqlRd;
Connection.Open();
SqlRd = SqlCmd.ExecuteReader();
while (SqlRd.Read())
{
if((UserName == SqlRd["Name"].ToString())&(Password == SqlRd["Password"].ToString()))
{
boolReturnValue=true;
break;
}
}
SqlRd.Close();
return boolReturnValue;
}
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
did you dibug you code ?
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
what to debug in that?
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
New one wrote: what to debug in that?
put breakpoints and step into the code.
|
|
|
|
|
No i didnt get whats the probs
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Read the article I link to in my sig. Then, do a search and learn how to debug your application. If you can't debug, not only can you not fix your problems, we can't either, because you don't know how to tell us what's going wrong.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
New one wrote: what to debug in that?
To identify your problem.
--------------------------------
There is nothing wrong in your code. try to debug step by step and check which lines goes wrong.
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Have you checked that your username and password are correct in the database where the login table is?
Are they case sensitive?
|
|
|
|
|
Really sorry guys i dont know same code i did in VB
Its working,
But in c# i cant find where is the error
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Session Variables is only working on the Same Page but its not transfering the value to another page in asp.net 2.0.How can I get a Session value.
KR.RAMESH
|
|
|
|
|
Member 3824224 wrote: Session Variables is only working on the Same Page but its not transfering the value to another page in asp.net 2.0
please clear your problem .
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
How are you accessing the value of session in the next page? Unless you give some more details it will be tough to understand the problem.
Apurva Kaushal
|
|
|
|
|
That's not possible. You need to post some code so we can see where your error is.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Login.aspx
gstrUserId = gmdataset.Tables(0).Rows(0)(0)
Session("USERID") = gstrUserId
game.aspx
dim lstrvalue as string
lstrvalue = Session("USERID").ToString
But i am not getting a value .but i am getting nothing only.How can i get a session value.
KR.RAMESH
|
|
|
|
|
Member 3824224 wrote: Session("USERID") = gstrUserId
Did you debug it to make sure this line is storing a value ? If so, then my guess would be that your server is set up to store sessions state in a DB that is not set up properly, or something along those lines. This code will just work on a properly set up PC, there's really no room for it to fail.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Are cookies enabled on the web browser?
What type of session are you using?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Login.aspx
gstrUserId = gmdataset.Tables(0).Rows(0)(0)
Session("USERID") = gstrUserId
game.aspx
dim lstrvalue as string
lstrvalue = Session("USERID").ToString
But i am not getting a value .but i am getting nothing only.How can i get a session value.
KR.RAMESH
|
|
|
|
|
Login.aspx
gstrUserId = gmdataset.Tables(0).Rows(0)(0)
Session("USERID") = gstrUserId
game.aspx
dim lstrvalue as string
lstrvalue = Session("USERID").ToString
But i am not getting a value .but i am getting nothing only.How can i get a session value.
KR.RAMESH
|
|
|
|
|
i had made a site in which there is table which has 15 lacs records.
when user access a form all records fetched from that table shown in that form.
when user search something large number of records are shown approx on average 10 lacs or above.
this will hanged all the site.
Is their any solution to solve this.
|
|
|
|
|
It is not necessary to display all the records at time. If it is based on searach then filter the search criteria that minimum of result comes. or you can use cache for that.
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
what on earth is a lacs ?
The solution is to optimise your SQL, and to write SQL that only returns a single page of data, so you can use paging to access your other records and you don't pull down records you don't show every time.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: what on earth is a lacs ?
1 lac = 100,000
“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”
|
|
|
|
|
As mentioned by CG you need to use paging concept. Display some records and if users wants get next set of records from the database.
Apurva Kaushal
|
|
|
|
|
Trying to fetch 15 lakh records at a time is a sure-kill on the IIS and the database server. You seriously need to consider revising your stored procedures to optimize the data access.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|