I can add rows and it automatically updates, work fine.
but when i try to delete a row, some can be delete some cant. but after all when I reload the list everything is unchanged..
then i try this: i got an error " Update requires a valid DeleteCommand when passed DataRow collection with deleted rows."Code:Dim response = MsgBox("Are you sure?", 4 Or 32, "") If response = MsgBoxResult.Yes Then rownum = SCD_allowedDataGrid.CurrentRowIndex SCD.SCD_allowed.Rows(rownum).Delete() Me.SCD_allowedDataGrid.Update() End If
ok...i think i need a deletecommand.
DELETE FROM [SCD allowed]
WHERE ???? <<< what do i put here if i want to delete a selected row?
Code:Dim response = MsgBox("Are you sure?", 4 Or 32, "") If response = MsgBoxResult.Yes Then rownum = SCD_allowedDataGrid.CurrentRowIndex SCD.SCD_allowed.Rows(rownum).Delete() Me.SCD_allowedTableAdapter.Update(SCD.SCD_allowed) End If




Reply With Quote