【发布时间】:2013-12-16 13:24:06
【问题描述】:
我需要一些关于从数据库中删除记录的帮助。
我正在尝试从我的 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
【问题讨论】:
标签: sql sql-server vb.net delete-record