SQLite net PCL - Simple select

前端 未结 2 1615
遇见更好的自我
遇见更好的自我 2021-02-20 09:40

I use SQLite from windows app and now I am developing in Xamarin a portable app so I am using the plugin sqlite net pcl and I am having great trouble to understand how it works.

2条回答
  •  情话喂你
    2021-02-20 10:19

    Hoping this will be usefull to someone in my place...

    Between the brackets (<>) goes the table name:

    db.Query("select * from ....");
    

    Some examples that worked for me:

    Simple select:

    var list = db.Query("select * from MyTableName");
    

    Select with restrictions:

    var list = db.Query("select * from MyTableName where lastname=? and firstname=?", lastnameValue, firstNameValue);
    

提交回复
热议问题