Back to Index

 

 

Job Component

     RunJob method

 

RunJob()

     Returns:  None

 

The RunJob method will execute your job process in the current thread and not return until the job has been completed.  If you need to run the job in the background, see RunJobThreaded.

Example:

[Visual Basic .NET]

Public Sub RunMyJob()

        Dim js As ExportBudget.CRJobStatus

        Dim myExportBudgetJob As ExportBudget

 

        myExportBudgetJob = New ExportBudget()

        myExportBudgetJob.JobPaths.JobStatusFileName = "ExportJobStatus.xml"

        myExportBudgetJob.RunJob()

 

        js = myExportBudgetJob.GetJobStatus()

 

        If Not (js Is Nothing) Then

            MsgBox("Job is done, Status: " + js.JobStatus.ToString)

        Else

            MsgBox("Job is done")

        End If

 

End Sub

 

[C#]

private void RunMyJob()

{

            ExportBudget.CRJobStatus js;

            ExportBudget myExportBudgetJob;

 

            myExportBudgetJob = new ExportBudget();

            myExportBudgetJob.JobPaths.JobStatusFileName = "ExportJobStatus.xml";

            myExportBudgetJob.RunJob();

 

            js = myExportBudgetJob.GetJobStatus();

 

            if (js != null)

            {

                  MessageBox.Show("Job is done, Status: " + js.JobStatus.ToString());

            }

            else

            {

                  MessageBox.Show("Job is done");

            }

 

}

 

 


© 2003 - 2007 Relational Solutions, Inc. - All rights reserved