从数据表中删除记录

时间:2012-02-03 11:23:18

标签: vb.net

我有以下代码在第一次执行时工作正常,但在再次执行时似乎没有找到先前删除的记录。任何建议。谢谢

    Private Sub TvContainer_NodeSelected(sender As Object, e As ComponentArt.Web.UI.TreeViewNodeEventArgs) Handles TvContainer.NodeSelected
    Dim no As Integer
    Dim dtpackunit As New DataTable 

    dtShipItem = Session("dsShipItem")
    dtpackunit = Session("dsUnit")

    no = TvContainer.SelectedNode.ID


    Dim dt As DataTable = dtpackunit

    Dim rows = dt.[Select]("No <> " & no)
    For Each row In rows
        row.Delete()
    Next

    gridbox.DataSource = dtpackunit
    gridbox.DataBind()

    gridship.DataSource = dtShipItem '.Select(filterExp, Nothing, Nothing)
    gridship.DataBind()
End Sub

0 个答案:

没有答案