Click here to Skip to main content
14,929,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello! Here a project on which I am working on currenty...what it does is it asks for the login information like username and password from user and verifies it with the values in the database..and if it matches with the values in the database it opens 2nd window where It gives user to change password.....
What I have done till now is stared a database named DB.mdf which has a table named userInfo_table and connected with the program...I am able to validate the user name and password from the user and open the second window but now I cant overwrite the value of password in the database so that from next time when user Logins user have to insert the new password...
Database details...
database name -- DB.mdf
Table name -- usrInfo_table
Columns -- Username and Password

Please download and evaluate this porgram...

Since you have already verified the user, I assume you are familiar with ADO.Net. You have go on the similar lines as you did for validating user name and password. Only difference being, for changing the password for the user, you would need to execute an update command. Something like this:
Update yourTable
set Password = 'changedPassword' 
where userName='currentUserName'
In that case you should read a book/tutorial on ADO.Net. .Net frameworkd provides a lot of classes to perform updates in the database. In your case, you would need OleDbConnection and OleDbCommand classes. Along with that you would also need to use CommandParameters. Have a look a these and you can work through.
1.add one class file(.cs) in your project
2.create a object in login form for that .cs file
3.declare the variable like
"public static string strUsername;" in .cs file
4.while user login,on button click(login button) assign the username in that variable("strUsername") second form(for change the password form) here also create object for .cs file
6.write update query like"update usrInfo_table set password='"+ txtpwd.text+"' where username='" + objcs.strUsername +"'"

objcs-->objects of cs file

Software Engineer
Gratiff solution and systems
No! sorry I am not familiar with ADO.Net...I have reached to here afer reading some books and watching Utube videos...Please Look at my work till now from the link i gave......

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900