@BenTam-3003 , you can convert your table data to a datatable, then you can use linq to get the first element.
Here is a code example you could refer to.
string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=School.accdb";
OleDbConnection connection = new OleDbConnection(connstr );
connection.Open();
string sql = "select * from Student";
OleDbDataAdapter adapter = new OleDbDataAdapter(sql, connection);
DataSet set=new DataSet();
adapter.Fill(set);
var table=set.Tables[0];
var result = table.AsEnumerable().Select(x => x.Field<int>("Age")).Take(1);
Console.WriteLine("First student Age is "+result.First());
Result:
If the response is helpful, please click "Accept Answer" and upvote it.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.