the idea is to do a winform where the user can change his username and password and when this is done update it onto the table. could you help me i'm new in vb.net, i'm usesing sql server 2000.
so far I have just done the login form where you put your name and password and that info is compare to the one in the table and it works fine but I need that part where the user can change his password.
Well generally a user can change their password ONLY after a successful login using the existing one, however it is good practice to ask them for the password again when changing.
So you would want a form with a field for old password, new password, and a confirmation of new password.
Validation you would need to perform before making the DB update would be to
1) determine that the existing password is valid
2) determine that the entered new password, and confirmation of it, match.
basically as far as the actual update to the DB, it would be a simple UPDATE SQL statement...
VB Code:
UPDATE tblMyTable SET [UserPassword] = '" & NewPassword & "' WHERE [UserID] = '" & UserID & "'"
where
tblMyTable is your table name
[UserPassword] is the field in the DB for their password
NewPassword is a string variable containing the new password
[UserID] is the field in the DB for their ID
UserID is a string variable containing their UserID
yes Im doing the thig that you say about and old password, but with the user id is a id on the table or what do you mean by user id. cause inmy table i have define id, username and password. the (id is autoincrementing) everytime a new user can be add, by the way how can I add and delete the users?
this is the code i have so far... there are part from many other codes that i put together but cant get it to work.
along i sen you my app so you can se what im trying to do wit it.