R
Robert
I am recieving a error when I call dataadapter.update
after deleting a row from the dataset. Does anyone have
any ideas?
The error is: Dynamic SQL generation for the
DeleteCommand is not supported against a SelectCommand
that does not return any key column information.
strSQL = "Select * from Category where CategoryID= " &
CategoryID
Dim DataAdapter As New SqlClient.SqlDataAdapter(strSQL,
strConn)
Dim DataSet As New Data.DataSet
Dim CommandBuilder As New SqlClient.SqlCommandBuilder
(DataAdapter)
DataAdapter.Fill(DataSet, "Category")
DataSet.Tables("Category").Rows(0).Delete()
DataAdapter.Update(DataSet, "Category")
after deleting a row from the dataset. Does anyone have
any ideas?
The error is: Dynamic SQL generation for the
DeleteCommand is not supported against a SelectCommand
that does not return any key column information.
strSQL = "Select * from Category where CategoryID= " &
CategoryID
Dim DataAdapter As New SqlClient.SqlDataAdapter(strSQL,
strConn)
Dim DataSet As New Data.DataSet
Dim CommandBuilder As New SqlClient.SqlCommandBuilder
(DataAdapter)
DataAdapter.Fill(DataSet, "Category")
DataSet.Tables("Category").Rows(0).Delete()
DataAdapter.Update(DataSet, "Category")