Problem: I have a page which is going to display the results of a variety of SQL queries I'm making against my SQLite DB. This first one is supposed to take the sum of a column and return it. I've used a variety of resources that detail how you make SQL queries and return them as useable variables but I've obviously not been successful. This is currently returning 'System.Threading.Task' as a string. Would love some insight as to where I've gone wrong here.
My DB method to get the sum of the DAYS column:
public Task<int> getLeaveDaysSum()
{
return _database.ExecuteScalarAsync<int>("SELECT SUM(DAYS) from [LeaveEntry]");
}
My OnAppearing method which will update the page label to display the result of the above method:
protected override void OnAppearing()
{
base.OnAppearing();
LeaveTakenDays.Text = App.Database.getLeaveDaysSum().ToString();
}
As always, if I can provide further details, please let me know. All help appreciated.