Private Sub DeleteButton_Click(sender As Object, e As EventArgs) Handles DeleteButton.Click
' Delete
Try
If MessageBox.Show("Do you want to permanently delete the selected record?",
"Delete Data", MessageBoxButtons.YesNo,
MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) =
Windows.Forms.DialogResult.Yes Then
Pass_TableBindingSource.RemoveCurrent()
Pass_TableBindingSource.EndEdit()
Pass_TableTableAdapter.Update(Pass_DBDataSet.pass_Table)
RefreshData()
MessageBox.Show("The record has been deleted successfully.",
"Data Deleted Successfully", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
Return '' Exit Sub
End If
Catch ex As Exception
MessageBox.Show("Delete Data Failed: " & ex.Message.ToString(),
"Delete Data Failed", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Это код, который я использовал для удаления записи. Я разрабатываю это программное обеспечение в Visual Studio 2019 (16.5.3)
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\pass_DB\pass_DB.mdb;Persist Security Info=True"
Вот ошибка, которую я получил. Error