c# - Login validation by using different tables having each email and password -


i have 4 tables student,tpo,admin,campany , each table having coloumn email , password when user entered values in login page i.e email text , password text validation query check tables , table having proper email , password can login if login credential belongs tpo tpo page can appear , if login credential belong student student can appear other process can done in same way.my form code asp.net , backed c#.

create procedure pro_login logic

create procedure pro_login @email varchar(max), @password varchar(max) begin if exists(select userid student userid=@email , password=@password)     begin     select 1     end     else if exists(select userid tpo userid=@email , password=@password)     begin     select 2     end     else if exists(select userid admin userid=@email , password=@password)     begin     select 3     end     else if exists(select userid campany userid=@email , password=@password)     begin     select 4     end end 

& write code in your.cs page

int res=login(txtuser.text, txtpass.text); if(res==1) { response.redirect("student.aspx"); } else if(res==2) { response.redirect("tpo.aspx"); } else if(res==3) { response.redirect("admin.aspx"); } else if(res==4) { response.redirect("campany.aspx"); } 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -