Click here to Skip to main content
15,917,456 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: window.confirm Pin
Arun.Immanuel24-Apr-07 4:15
Arun.Immanuel24-Apr-07 4:15 
GeneralRe: window.confirm Pin
Sujit Gupta24-Apr-07 7:51
Sujit Gupta24-Apr-07 7:51 
AnswerRe: window.confirm Pin
badgrs24-Apr-07 5:51
badgrs24-Apr-07 5:51 
QuestionPlz find out error in my code. Pin
Care Career24-Apr-07 2:27
Care Career24-Apr-07 2:27 
AnswerRe: Plz find out error in my code. Pin
Colin Angus Mackay24-Apr-07 2:32
Colin Angus Mackay24-Apr-07 2:32 
AnswerRe: Plz find out error in my code. Pin
Russell Jones24-Apr-07 2:42
Russell Jones24-Apr-07 2:42 
AnswerRe: Plz find out error in my code. Pin
Md. Ismail24-Apr-07 2:50
Md. Ismail24-Apr-07 2:50 
AnswerRe: Plz find out error in my code. Pin
Dave Sexton24-Apr-07 3:16
Dave Sexton24-Apr-07 3:16 
Well firstly you can't apply indexing with [] to a DataTable - it should be more like this (note bold text)

for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if ((txtUser.Text == ds.Tables["CreateAccount"].Rows[i]["User_Name"]) &&
                    (txtPassword.Text == ds.Tables["CreateAccount"].Rows[i]["Password"]))
                {
                    Response.Write("You have succesfully logged in");
                }
                else
                {
                    Response.Write("User Name Does Not Exist");
                }
            }


Also - I'm no C# guru but I find using the curly braces helps improve readability - one of the experts can correct me if I'm wrong but I don't see any harm in using curly braces in your "if" statement in this context.

Secondly, how do you know that the username doesn't exist if the password is wrong? I'd suggest either breaking it down into 2 separate helper functions to determine where the problem is or (easier) changing the response to "Either the username or password is incorrect".

Thirdly, you are passing the password as plaintext, which leads me to assume you're saving the password as plain text - bad idea. Rather use a hash to encrypt the password before processing or saving. Take a look at this[^]
GeneralRe: Plz find out error in my code. Pin
DeepToot24-Apr-07 5:11
DeepToot24-Apr-07 5:11 
GeneralRe: Plz find out error in my code. Pin
DeepToot24-Apr-07 5:13
DeepToot24-Apr-07 5:13 
GeneralRe: Plz find out error in my code. Pin
Dave Sexton24-Apr-07 10:36
Dave Sexton24-Apr-07 10:36 
AnswerRe: Plz find out error in my code. Pin
DeepToot24-Apr-07 5:21
DeepToot24-Apr-07 5:21 
AnswerRe: Plz find out error in my code. Pin
Sujit Gupta24-Apr-07 7:57
Sujit Gupta24-Apr-07 7:57 
Questionprint xsl Pin
TheEagle24-Apr-07 2:13
TheEagle24-Apr-07 2:13 
QuestionConfigurationsetting Class? Pin
Care Career24-Apr-07 0:25
Care Career24-Apr-07 0:25 
AnswerRe: Configurationsetting Class? Pin
Colin Angus Mackay24-Apr-07 0:36
Colin Angus Mackay24-Apr-07 0:36 
AnswerRe: Configurationsetting Class? Pin
Sandeep Kumar24-Apr-07 0:50
Sandeep Kumar24-Apr-07 0:50 
AnswerRe: Configurationsetting Class? Pin
Sathesh Sakthivel24-Apr-07 1:40
Sathesh Sakthivel24-Apr-07 1:40 
QuestionAdding a row to ASP.NET table programatically Pin
Rohde24-Apr-07 0:01
Rohde24-Apr-07 0:01 
AnswerRe: Adding a row to ASP.NET table programatically Pin
Spunky Coder24-Apr-07 0:48
Spunky Coder24-Apr-07 0:48 
GeneralRe: Adding a row to ASP.NET table programatically Pin
Rohde24-Apr-07 1:06
Rohde24-Apr-07 1:06 
GeneralRe: Adding a row to ASP.NET table programatically Pin
enjoycrack24-Apr-07 1:12
enjoycrack24-Apr-07 1:12 
GeneralRe: Adding a row to ASP.NET table programatically Pin
Rohde24-Apr-07 1:58
Rohde24-Apr-07 1:58 
AnswerRe: Adding a row to ASP.NET table programatically Pin
Nouman Bhatti24-Apr-07 1:17
Nouman Bhatti24-Apr-07 1:17 
QuestionAsp.net page cannot be displayed Pin
chater buster24-Apr-07 0:00
chater buster24-Apr-07 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.