Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New SqlConnection(My.Settings.MyConnectionString)
con.Open()
Dim cmd As New SqlCommand()
cmd.Connection = con
cmd.CommandTimeout = 0
cmd.CommandType = CommandType.Text
For Each item As ListViewItem In ListView1.CheckedItems
cmd.Parameters.Clear()
cmd.Parameters.Add("@param", SqlDbType.NVarChar)
cmd.Parameters("@param").Value = item
cmd.CommandText = "DELETE FROM SP_EXECUTION_TIMESTAMP WHERE Name = @param"
cmd.ExecuteNonQuery()
Next
con.Close()
MsgBox("OK")
End Sub
|