|
The Add button code looks like it should work, but the delete button needs some work. Before you can use the dataset, you must fill it with the data from the data adaptor. Try adding something like:
Dim DS As New DataSet()
DA.Fill(DS)
before calling the first line in the cmdDelete_Click method. That should work. The first one works because you "fill" the dataset with the new row.
As an aside, where is DS declared? Is there a reason it has larger scope than these button events? Always try to limit the scope of an object to the narrowest possible context. If you don't need DS to hang around and be used after the method exits, declare it in the individual procedures.
|