DougGerlach
Member
- Joined
- Jun 18, 2008
- Messages
- 7
- Programming Experience
- 1-3
i am having trouble doing a delete from with a dataadaper. i am able to update just fine.
i have two routines, one doing updates on a button press and another doing deletes on a button press
here is the update
and here is the delete
for whatever reason the delete never goes through unless i click the delete button and then the update button to update a different record. anyone else have problems with deletes?
i have two routines, one doing updates on a button press and another doing deletes on a button press
here is the update
VB.NET:
BindingSource1.EndEdit()
Dim con As New OleDb.OleDbConnection(conString)
Dim updateCmd As New OleDb.OleDbCommand("Update dept set description = '" & DescriptionTextBox.Text & "' where dept = '" & strOldDept & "' and cocodeid = 4", con)
da.UpdateCommand = updateCmd
da.Update(table)
da.UpdateCommand = Nothing
and here is the delete
VB.NET:
BindingSource1.EndEdit()
Dim con As New OleDb.OleDbConnection(conString)
Dim Cmd As New OleDb.OleDbCommand("delete from dept where dept = '" & DeptTextBox.Text & "' and cocodeid = 4", con)
da.DeleteCommand = Cmd
da.Update(table)
for whatever reason the delete never goes through unless i click the delete button and then the update button to update a different record. anyone else have problems with deletes?