ASP.NET 4.0 Login Website Part - 3 Database Scripting
Uploader Comments (Shmv90)
All Comments (35)
-
Thanks a lottt!! ...=)
-
thanks you very very much ^^
-
ei ...is it applicable for visusal studio 2008?cause when i type the codes that u are typing i get an error codes PLS REPLY
-
Thank you so muchhhh!!!!!! Really APPRECIATE!!! <3
-
@Shmv90 Hi, ive set the if to > 0 but its still not working... Could it be because im using a MasterPage...?
-
I suppose you could redirect to a new page just to diply the message and then using a timer redirct again back o the Registration page... aftersay 5 sec..
Anyone know how to do this??? Thread.Sleep(5000) doesnt seem to work, same problem as Respose.Write....
-
@brovashift I have replaced Response.Write with a Response.Redirect("Registratio
n.aspx"); which stops the incorrect data being entered into the db but I still cannot dispay a message to notify the user of whats happened or why the Registation form has been reset... Which would be very annoying to a user! Do you know of a way to notify the user after a Postback? Is it even possible?
Thanks again, thumbs up!
in the line
string cmdstr="select count(*) from Registration where UserName" * TextBoxUN.Text *;
what operator have u used before and after TextBoxUN, its not at all visible please can u re write this line for me in ur replyto this message!! ...
sanasz91 1 week ago
@sanasz91 It's like this:
string cmdstr = "Select count(*) from Registration where UserName" + TextBoxUN.Text + "'";
Note that before semicolon at last there is single quote between two double quote....like " ' "
Shmv90 6 days ago
Hi Shmv90.... Great tutorial...!
Was just wondering... When checking for existing UserName my "int temp" get a 0 (zero) for a new unique userName and any number greater than zero (1, 2, 3... consecutivly) for duplicate UserNames... What is the reason for that do you know?
I just changed mine to "if (temp !=0)"
When stepping through the code this works fine, however, when running the program the Response.Write("..."); does not show and the program continues to insert the duplicate UserName :-?
brovashift 1 month ago
@brovashift The whole logic behind that check is to ensure unique username to all registered Users. So, you should use if (temp == 1) or if (temp > 0) in your if loop condition and put Response.Write inside that. Because if variable temp has value 1 or larger that means user exist with same username and user should get notify about that.
Shmv90 1 month ago
@Shmv90 Ahh yes of course... normally when a duplicate username is entered the user is notified and a new unique username would be entered, which would mean temp is always either 0 or 1 nd no more... but becaue I was entering the same user several times for testing, thats why I WS getting nmber greater than 1... :) Silly me!
However, when a duplicate username is found the program still continues to insert the data into the database and the Response.Write does not show...?
brovashift 1 month ago
@brovashift then you should use if (temp > 0) because you already have more than 1 same usernames in your database. Just use this in your if loop condition and see if you get your Response.Write message.
Shmv90 1 month ago