I am trying to fetch the data from a SQL Server database table through Asp.net. I have used the query to Select the first row of the table using below code
SqlCommand cmd = new SqlCommand("Select top 1 * from Table1 Order by First_name", con);
How am I able to fetch the data from the first row of column named "attendance"?
I know it is something to do with the SqlDataReader
, but I am not sure how to use it. My aim is to add two columns of the first row "attendance" and "Percentage" which is of type float. Thank you.