I am working on this pet project in Xamarin.Forms cross platform. I am having difficulty running a query in SQLite using constraint. I am able to list all the elements stored on the table. However, I am unable to query the table for all the jobs with the same AccountNumber. I've searched everywhere but i can't find the answer. Can anyone provide a working method that would help please and thank you in advance.
public SearchPage()
{
InitializeComponent();
_connection = DependencyService.Get<ISQLiteDb> ().GetConnection();
}
private SQLiteAsyncConnection _connection;
private ObservableCollection<Job> _jobs;
public class NewJobTable
{
[PrimaryKey]
public string JobID { get; set; }
public long AccountNumber { get; set; }
public int JobNumber { get; set; }
public DateTime DateCompleted { get; set; }
}
protected override async void OnAppearing()
{
await _connection.CreateTableAsync<Job>();
var jobs = await _connection.Table<Job>().ToListAsync();
_jobs = new ObservableCollection<Job>(jobs);
JobListView.ItemsSource = _jobs;
base.OnAppearing();
}