User Validation on a Windows Form

I have a table in my db that stores usernames and passwords. I have a form (VB.NET) that has a username & pasword field that I want to validate against the db (i'm only interested in very basic security for this app anyway) . I have also set up the adapater & dataset and bound the controls.

I've looked all over the net for some advice but can only find .ASP login forms. How can I authenticate the text supplied in both fields against my db?
Craig_MucklestonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

khngCommented:
you can use a simple query like this one:

SELECT COUNT(*)
FROM user_table
WHERE user_id=text_box_text AND user_password=text_box_text;

This query return 1 on only if the id and password are corresponding to a single row.
Otherwise, 0 return invalid login
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TheHartfordCommented:
You can have a stored procedure in your db and validate it using SQL stmts. Pass ur userid and password as a parameters to the stored proceudure

hope that helps !

RR
0
Aldur1Commented:
personally i would just use this

passwordsRS.movefirst
for i = 1 to passwordsRS.recordcount
if PasswordsRS![Username] = txtUsername.text and PasswordsRS![Password] = txtPword.text then
frmLogin.hide
frmMain.show
else
PasswordsRS.movenext
end if
next i

if PasswordsRS.eof = true then
msgbox "Invalid Username or Password", VBOKOnly, "Login"
end if
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.