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