I'm wanting to display the first row of a SqlDataReader (its the only row/column the database returns) in a text field. I thought this was the correct syntax but i get 'no data' error. I can ensure that the sql query being used should definitely return an answer, i've checked it in SQL Server.
SqlCommand sqlCommand = new SqlCommand(sqlQuery, sqlConnection);
sqlConnection.Open();
SqlDataReader reader = sqlCommand.ExecuteReader();
Label1.Text = reader[0].ToString();
reader[0] doesn't seem to show anything.