listView.Items.Clear()
cmd.CommandText = " select Item1," & _
"Item2, " & _
"Item3, " & _
"Item4," & _
"Item5," & _
"Item6" & _
" FROM myTable"
gDR = cmd.ExecuteReader()
While gDR.Read
lstpenaltyview = listView.Items.Add(Null_To_String(gDR("Item1")))
lstpenaltyview.SubItems.Add(gDR("Item2"))
lstpenaltyview.SubItems.Add(gDR("Item3"))
lstpenaltyview.SubItems.Add(gDR("Item4"))
lstpenaltyview.SubItems.Add(gDR("Item5"))
lstpenaltyview.SubItems.Add(gDR("Item6"))
End While
一切看起来都不错,除了当我从表中删除一些东西时,我仍然注意到我的 ListView 中的旧项目。我确实清楚了不是吗?
谢谢你的帮助