Hi, im currently working with an SQL Server 2008 database and im trying to change values in the database usign visual basic.
The following code runs correctly and I have tested changing passwords and have been able to logoff and then back on again using the new password. The problem i am facing is that as soon as the application exits the database returns to its origional values so the next time i run the program the passwords are back to the old values.
If anyone has any ideas as to how to make the changes to the database permenant i would much appreciate it
Public Function ChangeUserPassword(ByVal newPass As String) As Boolean
newPassword = PasswordHasher.HashPassword(newPass)
GenerateSelectSqlCommandFromDetails()
If (ConfirmUser()) Then
GenerateUpdateSqlCommandFromDetails()
Try
sqlCommand.Connection.Open()
sqlCommand.ExecuteNonQuery()
sqlCommand.Connection.Close()
Return True
Catch ex As Exception
MessageBox.Show("There was a problem writing your new password to the database")
Finally
sqlCommand.Connection.Close()
End Try
Return False
Else
Return False
End If
End Function