gpt4 book ai didi

c# - SQLite 和 Windows Metro,正确的查询不返回数据

转载 作者:太空宇宙 更新时间:2023-11-03 13:54:53 24 4
gpt4 key购买 nike

我有一个奇怪的问题,

我在 Windows 8 应用程序上使用 SQLite,一切正常...除了一个查询。

我对 4 个不同的查询使用相同的方法(它们都返回相同的列),映射是正确的,因为至少其中一个在工作。

问题是...查询没有返回结果,如果我复制我的 sql 语句并手动将其运行到 sqlite 中,它会工作并返回 14 行...

我的sql语句是:“从 word_senses 中选择 w1.word_sense、w2.word 作为 w1,word_senses 作为 w2,其中 w1.equiv_word = 'A' 和 w1.ID = w2.ID 和 w1.word_sense != w2.word_sense 和 w2.usage & 66294!= 0 and w2.usage &3072= 0 order by w1.word_sense, w2.word"

执行查询的代码行是:

列出同义词 = await DBHelper.Instance.QueryAsync(sql);

映射是:

public class WordSynonymMapping
{
[SQLite.Column("word_sense")]
public int WordSense { get; set; }

[SQLite.Column("word")]
public string Word { get; set; }
}

我找不到解决方案...

这是一个实际有效的语句的副本......

“选择 w1.word_sense,e.example 作为来自 word_senses w1 的单词,示例 e where w1.equiv_word = 'A' and w1.usage & 0 = 0 and e.word_sense = w1.word_sense order by w1.word_sense,例如”

谁能帮我解决这个问题?我被困住了,不知道如何继续。

谢谢!

最佳答案

仅供遇到相同问题的其他人...我的数据库缺少一些索引,显然没有这些索引,查询最多需要 2 秒...当它花费那么多时间时,SQLite 返回空。

关于c# - SQLite 和 Windows Metro,正确的查询不返回数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12574636/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com