我在删除列表视图中的数据时遇到问题,我能够删除列表视图选择记录中的数据,但是选择的数据没有在数据库中删除,我有一个源代码
Private _updateinputalltrans As Boolean
Private Sub btndelete_Click(sender As System.Object, e As System.EventArgs) Handles btndelete.Click
With Me.listviewpos.SelectedItem
.Remove()
End With
MessageBox.Show("Are you sure delete this record?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, New EventHandler(AddressOf DeleteData))
End Sub
Private Sub DeleteData(ByVal sender As Object, ByVal e As EventArgs)
Dim conn As New Connection(Connectiondb)
If Me.updateinputalltrans = False Then
If Me.listviewpos.Items.Count > 0 Then
For Each del As ListViewItem In listviewpos.Items
conn.delete_dtpospart(del.Text)
Next
End If
End If
End Sub
delete_dtpospart 使用存储过程声明哪个数据库连接