Private Sub Execute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Execute.Click
Dim item As String
Dim node As TreeNode
node = TreeView1.SelectedNode
For Each item In CheckedListBox1.CheckedItems
Me.Label4.Visible = True
Me.PictureBox1.Visible = True
Me.Label7.Visible = True
Me.Label8.Visible = True
Me.Label7.Text = node.Text
Me.Label8.Text = item
Dim con As New SqlConnection(My.Settings.MyConnectionString)
con.Open()
Dim cmd As New SqlCommand()
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = item
cmd.CommandTimeout = 0
cmd.ExecuteNonQuery()
Next
MessageBox.Show("All selected procedures successfully executed!", "Status", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False)
End Sub
|