我使用Xamarin表单。我想使用SQL Lite查询选择我的动态列,但我得到了一个错误。
下面是我的模型:
public class MyWords
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
[JsonProperty(PropertyName = "id")]
public Guid MyId { get; set; } = Guid.NewGuid();
[JsonProperty(PropertyName = "languagevalue1")]
public string LanguageValue1 { get; set; }
[JsonProperty(PropertyName = "languagevalue2")]
public string LanguageValue2 { get; set; }
[JsonProperty(PropertyName = "languagevaluecombine")]
public string LanguageValueCombine { get { return LanguageValue1 + " " + Separator + " " + LanguageValue2; } }
}
我想获取列“languagevaluecombine”的值,但出现错误。
下面是我如何查询我的列“languagevaluecombine”表:
var ListCombine = conn.QueryAsync<MyWords>("select DISTINCT languagevaluecombine from MyWords ");
下面是得到的错误:
SQLite.SQLiteException has been thrown
no such column: languagevaluecombine
但是当我尝试使用列“languagevalue2”时,我认为它不是一个动态列
谢谢你的帮忙
1条答案
按热度按时间ggazkfy81#
首先,将数据加载到C#类中
则可以提取计算属性