Hi,
Please give me a secure method to check for login details..How to check for username and password against database in a secure way.. I do not want to use datareader object.. Is there any other way? Please suggest
Why you don't want to use datareader. Can you clarify?
Sir,
Will it not be a security issue.. As it is continuously connected to database.. If it is not then how can i write a method to check for login details against database
No it is not a security issue. You can simply write a query and use ExecuteScalar to get the value
int userId = (int)cmd.ExecuteScalar()
select userid from users where username = @username and password = @password
I am using 3 tier.. If you can show me a sample method i shall be grateful..
Thanks
You will not get 100% built sample anywhere on internet. I have given you query now you tell me where it is causing your trouble I'll help
© COPYRIGHT 2026 ASPSnippets.com ALL RIGHTS RESERVED.