It also throws an exception in code with the message 'String was not recognized as a valid Boolean.'. The dynamic type shows as object{long} and the value as 11.
Per the TableDDL, the column is defined as '[Enabled] BOOLEAN DEFAULT True,'.
Here is the example code I used:
Code: Select all
using System;
using Devart.Data.SQLite;
namespace devartSQLite
{
class Program
{
static void Main(string[] args)
{
using (var connection = new SQLiteConnection())
{
try
{
connection.ConnectionString = @"Data Source=C:\CMUD\Arctic\Arctic.dbm;FailIfMissing=False";
connection.Open();
using (var command = connection.CreateCommand())
{
command.CommandText = "SELECT * FROM [ObjectTbl]";
using (var reader = command.ExecuteReader())
{
// printing the column names
for (int i = 0; i < reader.FieldCount; i++)
{
var value = reader.GetName(i);
Console.Write($"{value.ToString()}\t");
}
Console.Write(Environment.NewLine);
// Always call Read before accesing data
while (reader.Read())
{
// printing the table content
for (int i = 0; i < reader.FieldCount; i++)
{
try
{
var value = reader.GetValue(i);
Console.Write($"{value.ToString()}\t");
}
catch
{
Console.Write("<Unable to read data>");
}
}
Console.Write(Environment.NewLine);
}
}
}
}
finally
{
if ((default(SQLiteConnection) != connection) && (!String.IsNullOrEmpty(connection.ServerVersion)))
{
connection.Close();
}
}
}
Console.Write("\n\nPress Any Key to Continue...");
var wait = Console.ReadKey();
}
}
}
--Patrick