我正在使用 sqlite v3,我有一个表,其中包含一些数据类型为“位”的列。我在此表中插入了一些数据,位列中的值为“true”,但问题是当我使用 C# 代码检索数据时,它总是返回值“false”。
相同的查询和相同的数据库适用于我的 android 应用程序。但是,当我从 C# 或 Windows 检索这些数据时,它会返回异常结果。
Sqlite 管理员在查询窗格中显示正确的结果.....我正在使用 chrome 浏览器....我的 C# 代码是
SQLiteConnection sqlite_connection =null;
if(isTrans)
sqlite_connection = sqliteTrans.Connection;
else
sqlite_connection = this.ConnectionInstance;
try
{
SQLiteCommand sqlite_command = new SQLiteCommand("SELECT AdditionalServices, VitalObservation from tblReadonlyPatientData where SubscriptionID = 1306", sqlite_connection);
SQLiteDataReader reader = sqlite_command.ExecuteReader();
StringBuilder queryToExecute = new StringBuilder();
while (reader.Read())
{
queryToExecute.Append(reader.GetString(0));
}
// always call Close when done reading.
reader.Close();
reader = null;
sqlite_command = null
}
catch (Exception e)
{
clsException.ExceptionInstance.HandleException(e);
throw;
}
finally
{
if (!isTrans && sqlite_connection != null)
{
if (sqlite_connection.State == System.Data.ConnectionState.Open)
sqlite_connection.Close();
}
}
这些列是位数据类型和“真”值,但返回假。