sqlite.net

SQLite.net: Query one single column


I have a model of the following form:

public class LanguageText
{
    [PrimaryKey]
    public int Id { get; set; }
    public string de { get; set; }
    public string en { get; set; }
    public string ru { get; set; }
}

How can I query just one column by Id? I tried this:

SQL = "SELECT [de] from [LanguageText] WHERE [Id] = \"1\""
var p = App.Database.QueryAsync<LanguageText>(SQL).Result.First();

This will return one whole row of LanguageText in p, while I want the contents of the [de] row as string only.

How do I accomplish this?


Solution

  • As we found out

    App.Database.ExecuteScalarAsync<string>(SQL).Result