Hope someone can help
I am using Visual Studio 10 Languague VB
It is web based and conects to remote SQL Server
If i run a query on database connecting using Sql Server management studio
this query give correct results which is to find minimum value in a column called TIME1.
The query on database is SELECT MIN(TIME1) AS Fastest
WHERE (ATHLETE = 'Joe Bloggs') AND (Session = '600m')
This works great showing correct result under Alias column name Fastest
My problrm is i want to get this result from code behind page
here is Query in code behind page
SqlDataSource1.SelectCommand = "SELECT MIN(TIME1) from Athletes WHERE (Session ='600m') AND (ATHLETE = 'Joe Bloggs')"
I need to extract min value of TIME1 and pass it to a variable
Any help wpold be greatly appreciated