Last post Dec 02, 2011 07:15 AM by simsen
Dec 01, 2011 12:15 PM|kenny90|LINK
I have my form connecting to my MS Access database. i am creating a login page where there are two text boxes userID and pin.
what i would like to happen is if the user enters a userID starting with R and the password is right then they should be brought to one page but if the user enters a userID starting with L then they are brought to a different page.
Dec 01, 2011 12:27 PM|Curt_C|LINK
use the Login1.LoggedIn (assuming you are using the Login control) for post login processing...just Response.Redirect(...) accordingly
Dec 01, 2011 12:30 PM|kenny90|LINK
No i'm using two texboxes and a button
Dec 01, 2011 01:42 PM|simsen|LINK
In your bottons event handling where you check if it's the right userId and pin you have to write a little bit more if the user exists....
else if (theTextBoxWithuserName.Text.Trim().StartsWith("R"))
//Do something here if it's none of the above
Dec 01, 2011 02:33 PM|kenny90|LINK
THat was the answer. Thanks
do you know how to imput data into 2 tables in my database at the same time?
Dec 02, 2011 07:15 AM|simsen|LINK
One thing you have to be aware of is that (I think it's so) that my suggestion is case sensitive. That means if the user writes "s" and you only ask for "S" it wil refuse to go into the if statement.
Make you string to upper- or lower case like this before you do your if statement;
string test2 = "Hi";
string test3 = test2.ToLower();
string test4 = test2.ToUpper();
and then make the if statement on test3 or test4 (what you want to use);
Regarding input to 2 tables - you have to make to inserts;
insert into table1 (name, address) VALUES ("Martin", "Schmidt")
insert into table2 (name, address) VALUES ("Martin", "Schmidt")
But you can do it in one stored procedure (if you use that)... We have to know more information about how you do it now to help you here :-)