Difficulty Updating Dataset
Hi Guys, i was wondering if anyone can spot my mistake for this one.. I can delete the any row i choose in the datagrid however the changes is not being reflected in either the datset/database. Thanks
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim Response As DialogResult
Dim dsDeletedRows As DataSet
dsDeletedRows = DsFileStorage1.GetChanges(DataRowState.Deleted)
Response = MessageBox.Show("Confirm Delete Record?", "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
Select Case Response
Case DialogResult.Yes
If (Me.BindingContext(DsFileStorage1, "Disk").Count > 0) Then
Me.BindingContext(DsFileStorage1, "Disk").RemoveAt(Me.BindingContext(DsFileStorage1, "Disk").Position)
odbdaFileStorage.Update(dsDeletedRows)
End If
Case Else
Return
End Select
End Sub