所以我正在尝试更改我正在处理的 vb.net 项目中的用户密码。但每次我运行我的代码时,我都会发现“出了点问题”。我不知道为什么。我正在使用 MYSQL 数据库。有谁能够帮我?
Try
reader = cmd.ExecuteReader()
Dim found As Boolean = False
Do While reader.Read()
If username = DirectCast(reader("username"), String) Then
If password = DirectCast(reader("password"), String) Then
found = True
Else
MessageBox.Show("username and password do not match")
End If
End If
If found = True Then
Dim cmd2 As New MySqlCommand
Dim insertStatment As String = "UPDATE login set password = '" +
newpassword + "' where username = '" + username + "'" , con)
cmd2.ExecuteNonQuery()
MessageBox.Show("password change successfully")
'End If
End If
Loop
Catch
MessageBox.Show("Something went wrong")