How to create login with user roles in asp.net -


there 2 tables 1 login email id, username, password, name , email id primary key , second table employee_role id primary key, emp_role, , emailid foreign key of login email id.

here condition in emprole there admin , whenver user log in first check if emaild id in employee_role if yes direct "admin page" if otherwise didnot find emailid direct "guest page"

please fresher me...

please fresher me... 

we started somewhere no problem their. know see got number of downvotes. because didnt try or didnt share tried yet. here general advice on issues. need them little more, , questions. had make number of assumptions started here.

there 2 tables 1 login email id, username, password, name , email id primary key , second table employee_role id primary key, emp_role, , emailid foreign key of login email id. 

i assume dont need specific assistance creating these tables. know foreign-key , primary-key constraints.

here condition in emprole there admin , whenver user log in first check if emaild id in employee_role if yes direct "admin page" if otherwise didnot find emailid direct "guest page" 

here 1 way acheive in sql:

select l.email, l.userid, l.password,  case when r.emp_role not null 'admin.aspx' else 'guest.aspx' end  'transferpage' dbo.login l left outer join dbo.employee_role r on l.emailid = r.emailid email = @email  --assumes pass in parameter @email 

take results of query , compare password of returned query password of entered text , if valid

response.redirect 

to page query returned.

hope helps...


Comments