Now, i can connect MS SQL Server 2000 via connection string and get job name and job
status in SQL Server Agent. but i want to show name and status continuously follow time
schedule recurring for monitoring JOB. Please suggestion how to do. (using MS Visual
Studio 2008 (C#))
public void ConnectJOB()
{
SQLDMO._SQLServer SQLServer = new SQLDMO.SQLServerClass();
try
{
SQLServer.Connect("10.17.13.70", "sa", "");
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
SQLDMO.JobServer jobServer = SQLServer.JobServer;
foreach (SQLDMO.Job job in jobServer.Jobs)
{
string jobName = job.Name;
SQLDMO.SQLDMO_JOBEXECUTION_STATUS status = job.CurrentRunStatus;
richTextBox1.Text = jobName.ToString();
richTextBox2.Text = status.ToString();
}