locked
How to use binding with condition ? RRS feed

  • Question

  • User369473 posted

    I want to show Activity Name from Sqlite database ,but I dont to show them all , I want to show only them who have the IDUser=null . How can I do that , this is my code but its showing all !

    Friday, September 14, 2018 4:05 PM

Answers

  • User53115 posted

    conn.Table<Challenge>().Where(c => c.IDCreator == idcreater).ToList();

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, September 14, 2018 4:35 PM

All replies

  • User2148 posted

    Is Activity a property in Challenge Model?

    Friday, September 14, 2018 4:08 PM
  • User369473 posted

    @AlessandroCaliaro said: Is Activity a property in Challenge Model?

    Yes

    Friday, September 14, 2018 4:12 PM
  • User53115 posted

    Put a where clause on your database query.

    Friday, September 14, 2018 4:19 PM
  • User2148 posted

    @JoeManke said: Put a where clause on your database query.

    Yes, @JoeManke is right

    Friday, September 14, 2018 4:20 PM
  • User369473 posted

    @JoeManke said: Put a where clause on your database query.

    Can you give me an example how can I use where there !

    Friday, September 14, 2018 4:21 PM
  • User2148 posted
    // Not tested… 
    conn.Table<Challenge>().ToList().Where(a=>a.IdUser != null) 
    
    Friday, September 14, 2018 4:23 PM
  • User2148 posted

    https://github.com/praeclarum/sqlite-net#synchronous-api Here you can find some samples

    Friday, September 14, 2018 4:24 PM
  • User369473 posted

    @AlessandroCaliaro said: // Not tested… conn.Table().ToList().Where(a=>a.IdUser != null)

    Not working

    Friday, September 14, 2018 4:27 PM
  • User53115 posted

    conn.Table<Challenge>().Where(c => c.IDCreator == idcreater).ToList();

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, September 14, 2018 4:35 PM
  • User2148 posted

    It seems there is only one =

    Friday, September 14, 2018 4:35 PM
  • User369473 posted

    Thank you guys but This code is not showing anything in the list ,

    Friday, September 14, 2018 4:56 PM
  • User53115 posted

    Well then your database doesn't have any Challenges matching that ID.

    Friday, September 14, 2018 4:57 PM
  • User369473 posted

    @JoeManke said: Well then your database doesn't have any Challenges matching that ID.

    Sorry guys my mistake , the code is working well , very very thanks for all the help !

    Friday, September 14, 2018 4:59 PM