G
Guest
Can anyone get sp_help_job to execute via ado.net ??
The following code produces a "severe error occurred on the command object"
SqlConnection connection = new SqlConnection(connectionString)
connection.Open()
SqlCommand cmd = new SqlCommand()
cmd.Connection = connection
cmd.CommandText = "exec msdb.dbo.sp_help_job @job_name='My SQL Job',@job_aspect='JOB'"
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandTimeout = 90
SqlDataAdapter da = new SqlDataAdapter(cmd)
DataSet ds = new DataSet()
da.Fill(ds)
connection.Close()
I can execute the same command Text in SQL Query Analyzer without a problem (using the same connection id and pwd)
Even if I don't pass any parms I get the error. I've tried to execute it as a proc and as text
Any ideas ??
The following code produces a "severe error occurred on the command object"
SqlConnection connection = new SqlConnection(connectionString)
connection.Open()
SqlCommand cmd = new SqlCommand()
cmd.Connection = connection
cmd.CommandText = "exec msdb.dbo.sp_help_job @job_name='My SQL Job',@job_aspect='JOB'"
cmd.CommandType = System.Data.CommandType.Text
cmd.CommandTimeout = 90
SqlDataAdapter da = new SqlDataAdapter(cmd)
DataSet ds = new DataSet()
da.Fill(ds)
connection.Close()
I can execute the same command Text in SQL Query Analyzer without a problem (using the same connection id and pwd)
Even if I don't pass any parms I get the error. I've tried to execute it as a proc and as text
Any ideas ??