Hello,
I have troubles to delete rows in my database.
The following code will be executed when I click 'delete' button
(ds is a dataset)
So now my row is deleted in the datatable but not even in the database.
To do that, I have the following code:
daGenre is my oleDbDataAdapter.
When I execute this code, there is no Exception but my rows are still in my database
Anyone how knows what the problem is?
Thx 4 reply!
I have troubles to delete rows in my database.
The following code will be executed when I click 'delete' button
VB.NET:
ds.Tables("dtGenres").Rows.RemoveAt(TdgGenres.CurrentCell.RowNumber)
(ds is a dataset)
So now my row is deleted in the datatable but not even in the database.
To do that, I have the following code:
VB.NET:
Dim sqlDeleteGenre As String
sqlDeleteGenre = _
"delete from tblGenre where id=?"
With daGenre
.DeleteCommand = New OleDbCommand(sqlDeleteGenre, cnn)
.DeleteCommand.Parameters.Add("genid", OleDbType.BSTR, 2, "GenId")
End With
daGenre.Update(ds, "dtGenres")
ds.Tables("dtGenres").AcceptChanges()
daGenre is my oleDbDataAdapter.
When I execute this code, there is no Exception but my rows are still in my database
Anyone how knows what the problem is?
Thx 4 reply!