Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi....
I am creating a C#.Net project windows based application.
I want to create a login page. In login page there should be Census year, username, password fields.

I have a table of census year. Login will be based on selected year, username and password.

What should i do to login? Should i create a datatable for username, password and year? or create session?
I think session can not be created in window application..so what should i do?

Kindly help me.
sakshi
my mail id is [Email removed to avoid spam]
Posted
Updated 31-May-10 20:59pm
v2

khandelwal g wrote:
or create session?
I think session can not be created in window application


Yes, there are no sessions in Windows application.


khandelwal g wrote:
what should i do?


1. Design your tables such that based on a given year and username, you can verify if the password matches and thus autehnticates a user.
2. In your UI, take the parameters - Census years, Username and password
3. Pass on the values to DB
4. Verify if the user is valid based on the data
5. Return true(if ok) or false(if not ok)
6. based on true/false, move on to next form.
 
Share this answer
 
The first post is correct there is no session for win apps.
I would also add some security to the db for passwords.
this is getting to be a very serious concern in keeping these secret.
 
Share this answer
 
Hello

There is no sessions in windows application.

Inorder to provide security for passwords in db, you need to HASH the password and save in database, so that when queried from backend also the password will appear hashed.

But when users logins in by typing the password, u need to get the string and HASH it and check the resulting HASH value with the database HASHED password value.

if both are correct then allow the user to login successfully else display the error message.
 
Share this answer
 
Hi,

1.)Create table with fields year,username and password
2.)Write Sql Db parameters in code behind and connect it
3.)Check username, password and year if its in db then redirect to some page
 
Share this answer
 

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