Click here to Skip to main content
16,008,719 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dim ddrc As Int16 = (Me.Temp_QuotesDataGridView.RowCount - 1)

With (Me.Temp_QuotesDataGridView)
    For Xxx = ddrc To 0 Step -1
        .Rows.Remove(.Rows(Xxx))
    Next
End With
Me.Validate()
Me.Temp_QuotesBindingSource.EndEdit()
Me.Temp_QuotesTableAdapter.Update(Me.M_B_DATABASEDataSet)

whats wrong with that code that it doesnt really delete from the database
it shows the records are gone from the datagridview but when i open the database all the records are still.
i am using vb.net strongly typed access database
Posted
Comments
mena amin 2023 6-Jan-24 19:40pm    
How do I prevent Data Grid View from entering duplicate data into Access vb.net

1 solution

You removed the rows from the DataGridView. You did NOT tag the rows in the DataTable to be deleted. You dont do operations like this on the DGV. You do them on the storage object that you bound the DGV to.
 
Share this answer
 
Comments
Member 10862570 29-Jun-14 22:56pm    
then how can i bound it?
please help
normally that works with add but its not working with delete!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900