When opening the form and following the Form structure to delete the record, it does delete from my Form.datagridview, but when closing and reloading the form, the record is there.
my source database shows in the 'server explorer' with the "red x" and remains red throughout the life of the form, start to finish and restart.
I'm wracking my brains. My poor brains. I have tries myriads of tableadapter and binding source combinations, to no avail.
Does anyone have any ideas?
Public Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
If Me.EnableEditingCheckbox.Checked Then
If Me.AddNewButton.Text = "Cancel" Then
Exit Sub
End If
If Not DataGridView1.Rows.Count = 0 Then
Try
Dim result As DialogResult
result = MessageBox.Show("Do you want to permantely DELETE the selected record?", "DELETION Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = DialogResult.Yes Then
Me.TTimeBindingSource.RemoveCurrent()
Me.TTimeBindingSource.EndEdit()
Me.TTimeTableAdapter.Update(DocketMV4DataSet1Apr1.tTime)
End If
Catch ex As Exception
End Try
End If
Else
MessageBox.Show("Access Denied!" & Environment.NewLine & "You need permission to perform this action" & Environment.NewLine & Environment.NewLine & "Please contact the programmer or ask Google!", "Delete operation failed", MessageBoxButtons.OK, MessageBoxIcon.Stop)
Return
Exit Sub
End If
End Sub