If the HasRows property returns true, the result set most likely really has rows. However, initially you're not positioned in the first row so if you try to fetch the values, you'll get an exception.
Use the
Read mehtod[
^] to advance in the result set and see what it contains.
To clarify the situation it could be helpful if you include columns Date and emplyoeeid to the result set.
Also notice that since date is a reserved word the column name should be surrounded with brackets: .. WHERE [Date] = ...
And one more thing. The result set will contain rows as long as the WHERE condition is satisfied, regardless if the AfternoonTime-Out column as a value or not. You can see if the column contains a NULL value by comparing it to
DBNull.Value [
^] in C#. If you want to exclude null rows, you need to modify the WHERE clause, for example:
Dim Query1 As String = "Select [AfternoonTime-Out] From Table_DTR Where Date = @Date and EmployeeID = @EmpID AND [AfternoonTime-Out] IS NOT NULL"