我需要一些幫助從數據庫刪除記錄。從數據庫刪除記錄時出錯
我想從我的SQL Server數據庫中的表中刪除一條記錄。
我錯過了什麼嗎?
Private Sub cmdDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdDelete.Click
_DataSet.Tables(0).Rows(CInt(txtCurrent.Text) - 1).Delete()
' tho, it can remove the deleted rows
' we cannot call the DataSet.AcceptChanges method
' because the DataAdapter would not recognize the delete row
' by the time DataAdapter.Update(DataSet) is called.
EnableNavigation()
cmdSave.Enabled = True ' let user update the underlying database
' after deleting the current record, the current record still points to the
' deleted record (though it cannot be updated).
' The user must MoveNext/Back to view other records.
End Sub
我有這個錯誤:刪除表上的記錄時出錯...值不能爲空。 參數名稱:datatable – user2968155