Click here to Skip to main content
15,920,383 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i create a User Authentication form,getting values from local DB.I am using sqlce,windows mobile application!!!!
Posted

1 solution

So presumably, you have a suitable user information table set up in SqlCE?

Then it is just a case of creating a form, adding a username and a password field, and a "login" button.

You then check the details against the database, and either log them in or not as appropriate. I would use a hash for the password as usual (there is a tip here that may be worth reading Password Storage: How to do it.[^]), but it's nothing complex - what part of this is giving you difficulties?
 
Share this answer
 
Comments
IviKAZAZI 11-Feb-12 5:41am    
the problem is that after checking the user and pass,the user might have different permissions,how can i add it?or i can just use different menu forms depending from the user & pass?
OriginalGriff 11-Feb-12 5:48am    
The normal way is to give each user one or more Roles - Admin, AccountsPerson, user, idiot, that sort of thing - which is stored in the DB with the other user info. You then either allow or deny access to entire pages, or hide controls on existing pages as appropriate for the user role. I generally do both - hide or disable the controls to get to a page, and block pages themselves in the Constructor or the Load event.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900