I am getting a RowNotInTableException with this error message when I attempt to delete a row from my database using a SqlDataAdapter.
Here is my code to build the DeleteCommand.
My stored procedure executes correctly in Query Analyzer.
I found something on the web that said this error could be caused by the delete command reading from the current dataset values instead of the original. So, I created a dataview of the dataset and can see that the original values are in the dataview just before the sqldataadapter.update is executed.
I'm running out of ideas, so any help would be appreciated.
Thanks,
Andrea
My dataset is bound to a grid, and I delete the row by deleting a row on the grid.This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.
Here is my code to build the DeleteCommand.
Code:
cmdComponents = New SqlCommand
With cmdComponents
.Connection = cnnComponents
.CommandType = CommandType.StoredProcedure
.CommandText = "aih_clDeleteKitComponents"
.Parameters.Add(New SqlParameter("@KitNo", SqlDbType.VarChar, 30, "kit_no"))
.Parameters.Add(New SqlParameter("@SequenceId", SqlDbType.Int, 4, "sequence_id"))
End With
daComponents.DeleteCommand = cmdComponents
I found something on the web that said this error could be caused by the delete command reading from the current dataset values instead of the original. So, I created a dataview of the dataset and can see that the original values are in the dataview just before the sqldataadapter.update is executed.
I'm running out of ideas, so any help would be appreciated.
Thanks,
Andrea