Hello I'm currently working on my bachelor's graduate project and it is going to be a medical related website.
I'm using ASP.NET, VB.NET and SQL Server and I want to have all the users login to the website from the same form/webpage/button and then be directed to different pages according to their type or the SQL table they belong to.
I've managed to create a successful login for each table (type of user) but it will be inconvenient that everyone logs in from different pages.
each user has a table in SQL with username and password fields and they are:
Admin, Facility_Admin, Doctor, Records_Employee, Care_Worker, Nurse, Pharmacist, Patient.
I've seen some programmers who create a table for users and have a user type field in it but I haven't found further info or explanations about it or how to apply it to an ASP.NET website.
Asked
Active
Viewed 95 times
0

Roba M
- 3
- 1
2 Answers
0
The best way to do login users and membership , by run aspnet_regsql.exe
for more information How to use aspnet_regsql.exe

Community
- 1
- 1

Mohamed Qassim
- 37
- 6
0
Yes you said right, better way is to have user type in users table. Process is simple, when you checked user name and password from database you must have returned something like true or false. All you need to do is return user type field value along with this true or false field being returned during login process. You might need to know about OUTPUT type parameters from sql server to do this.
And based on this user type field value returned from db, you can easily redirect your user to any page.
Hope this will help you.

Malkit Singh
- 349
- 1
- 8
-
thank you. what I'm going to do now is that I'll create the users table and as any type of user record is added on the website it'll be added on the main table and on the new users table at the same time do you think this is effective or is there a better way to add to the users table? and I think this is the important part of the login code:'Dim cmd As New SqlCommand("select * from Admin_Table where UserName =@username and Password=@password", con) cmd.Parameters.AddWithValue("@username", txtUserName.Text) cmd.Parameters.AddWithValue("@password", txtPWD.Text)' – Roba M Oct 13 '14 at 13:18