I’ve been using SqlDataReader to read results from my querys to an SQL server db.
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Console.WriteLine(rdr["ColumnName"].ToString());
}
But now I want to create a Job in my C# program, and when I do that, the return value (the ID of the created job), comes in a column with no name.
How to execute sql command and read its return value when the column has no name?
Retrieve the column by index:
rdr[0]