|
|
I am developing a VB.Net application using Visual Studio 2008 (VB) and SQL Server 2008 Express.
I have a table with (say) 7 records in it. If I select a record and then hit delete, the record is deleted but the counter shows that 2 have been deleted.
If I have 1 record in the table, an exception is thrown saying that I have no record selected.
The RemoveCurrent line only appears once in the code. Setting a breakpoint shows that the code is only executed once.
This happens on all dialogs connected to any of the tables in the database, all of which have primary keys defined.
The code snippet below is the code I am using (auto-generated by VS).
If I remove the check to confirm deletion the problem doesn't occur.Code:Private Sub BindingNavigatorDeleteItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorDeleteItem.Click If MessageBox.Show("Delete", "Delete", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then TblDocumentsBindingSource.RemoveCurrent() TblDocumentsTableAdapter.Update(FilingRegisterDataSet) End if End Sub
Attached image shows what I mean.
![]()
Last edited by AveryHilditch; 02-04-2010 at 9:49 PM. Reason: Copied the wrong code
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks