locked
SQLite Select RRS feed

Answers

  • User369978 posted

    Check https://docs.microsoft.com/en-us/xamarin/get-started/quickstarts/database?pivots=windows .

    Look at step 7.

    Something like

    ``` public Task GetNoteAsync(int id) { return _database.Table() .Where(i => i.ID == id) .FirstOrDefaultAsync(); }

    //usage _database.GetNoteAsync(1); ```

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, November 20, 2020 9:10 AM

All replies

  • User369978 posted

    Checked the detailed code in official sample : https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/getstarted-tutorials-localdatabasetutorial/ .

    What is the exact problem are you facing ? Could you elaborate more about it ?

    Friday, November 20, 2020 5:39 AM
  • User377900 posted

    Let's say I want to add a new xaml page NewPage.xaml to the previous example then I want to display the name when ID is 1 from code behind NewPage.xaml.cs then display name in DisplayAlert, How can I do that?

    Friday, November 20, 2020 7:55 AM
  • User369978 posted

    Check https://docs.microsoft.com/en-us/xamarin/get-started/quickstarts/database?pivots=windows .

    Look at step 7.

    Something like

    ``` public Task GetNoteAsync(int id) { return _database.Table() .Where(i => i.ID == id) .FirstOrDefaultAsync(); }

    //usage _database.GetNoteAsync(1); ```

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, November 20, 2020 9:10 AM