Crookshanks
Technical User
Hello there,
I have problems with updating the data in the data source (Accessdatabase). I am writing an eventhandler that should reset the password of a user.
daUsers = data-Adapter
dsUsers = dataset
drUsers = the current row
Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
response = MsgBox("Weet U zeker dan u het wachtwoord wilt resetten?", MsgBoxStyle.YesNo)
If response = MsgBoxResult.No Then Exit Sub
drUsers.Item("Password") = InitialPassword 'change record
Try
Me.daUsers.Update(Me.dsUsers.Users)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
When I try to save the change to the actual database I've got the following exception error. Could someone please explain why I am receiving this?
Errormessage:
SystemInvalidOperationsException: Update requieres a valid update command when passed dataRow collection with modified rows.
What am I doing wrong?
Kind regards,
I have problems with updating the data in the data source (Accessdatabase). I am writing an eventhandler that should reset the password of a user.
daUsers = data-Adapter
dsUsers = dataset
drUsers = the current row
Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
response = MsgBox("Weet U zeker dan u het wachtwoord wilt resetten?", MsgBoxStyle.YesNo)
If response = MsgBoxResult.No Then Exit Sub
drUsers.Item("Password") = InitialPassword 'change record
Try
Me.daUsers.Update(Me.dsUsers.Users)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
When I try to save the change to the actual database I've got the following exception error. Could someone please explain why I am receiving this?
Errormessage:
SystemInvalidOperationsException: Update requieres a valid update command when passed dataRow collection with modified rows.
What am I doing wrong?
Kind regards,