All pastes #754276 Raw Edit

Someone

public text v1 · immutable
#754276 ·published 2007-10-29 22:00 UTC
rendered paste body
        Dim tblEggs As DataTable
        tblEggs = TestDataSet1.Tables("Eggs")

        Dim drCurrent As DataRow
        drCurrent = tblEggs.Rows.Find(ListBox1.SelectedValue)

        'prompt to save changes
        If MsgBox("OK to delete?", MsgBoxStyle.OkCancel, "Confirm Delete") = MsgBoxResult.Ok Then
            'delete it from the dataset
            drCurrent.Delete()
            EggsBindingSource.EndEdit()
            EggsTableAdapter1.Update(TestDataSet1.Eggs)
        End If


' this doesn't seem to be working

' i have a listbox bound to datasource, display member "nick" and value member "ID" where id is the primary key starting at 1....

' it seems to delete it from the collection but when i close the app and view table data the data is still there and when the app re-opens ofcourse the 'data remains. Doesn't seem like its saving the changes.....

' i'm not sure but this just isn't deleting the row from the database ....