C# 特殊行为
我正在为Windows使用SqliteCipher 我正在C Windows窗体应用程序中使用它。我的代码是这样的C# 特殊行为,c#,sqlite,C#,Sqlite,我正在为Windows使用SqliteCipher 我正在C Windows窗体应用程序中使用它。我的代码是这样的 cmd.CommandText = "SELECT rcno from blockftins where status='0' and rcno >" + lastrcno + " and rcno <=" + goupto + " Limit 1"; var readerftin = cmd.ExecuteReader(); while (readerftin.Re
cmd.CommandText = "SELECT rcno from blockftins where status='0' and rcno >" + lastrcno + " and rcno <=" + goupto + " Limit 1";
var readerftin = cmd.ExecuteReader();
while (readerftin.Read())
{
//starts from a specific record
lastrcno = readerftin.GetInt32(0);
}
该表有17391条记录。当我的lastrcno设置为17390且goupto为17391时,它无法检索任何记录
但是,如果通过在sqlite命令提示符下的Textvisualier中捕获结果代码来运行结果代码,则得到的lastrecno为17391,这是正确的答案
从文本捕获的代码是可视化的-
SELECT rcno
FROM blockftins
WHERE status = '0' AND rcno > 17390 AND rcno <=17391 LIMIT 1
这种奇怪的行为有什么原因吗
问题似乎出在最后两张唱片上-
cmd.CommandText = "SELECT rcno from blockftins where status='0' and rcno <=" + 17390 + " Limit 1";/
cmd.CommandText = "SELECT rcno from blockftins where status='0' and rcno <=" + 17391 + " Limit 1";/
没有记录。
然而
检索正确的记录。您确定这是同一个数据库吗?是的,它们是同一个数据库。您对此有何证据?您所显示的将表明您使用的是不同的数据库。我确信数据库是相同的,并且查询select countrcno from blockftins在Windowsform和sqlite命令提示符下检索17391条记录。另一点是,如果我将lastrcno设置为17388,则只有Windowsform应用程序检索记录。它适用于所有小于该值的数字。
cmd.CommandText = "SELECT rcno from blockftins where status='0' and rcno <=" + 17389 + " Limit 1";/