?
Solved

Triggering events when a job from SQL server finishes

Posted on 2004-09-15
3
Medium Priority
?
291 Views
Last Modified: 2012-05-05
I am writing an application that shows a list of jobs available from SQL server. It allows the user to select a job and start it. My question is how do I let the user know that the job has finished before executing the next job. I know that in VB 6 you had some events that were triggered by a connection object(Execute_Complete) but that is not the case in vb.net. Is there a way that this can be done?

Thanks
0
Comment
Question by:ggarracrema
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 2000 total points
ID: 12071882
Well if you are just looking for an equivalent of Execute_Complete you can use StateChange event of the Connection object.

For eg
Say you have a connection...
Dim Cn as SQLConnection=New SqlConnection(ConnectString)

Create a Handler for StateChange Event...
AddHandler Cn.StateChange, New StateChangeEventHandler(AddressOf OnStateChange)

Then..
Public Sub OnStateChange(sender As Object, args As StateChangeEventArgs)
       Here Check if args.CurrentState is not one of Connecting,Executing and Fetching, it means it is idle
       Also to be sure you can check if args.OriginalState was either Executing or Fetching based on your query

End Sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question