Problem with boolean columns
Posted: Fri 28 Jan 2011 16:29
When i create a model from a table in SQLite which contains boolean columns, the resulting property is created as System.Object instead of System.Boolean.
Running a LINQ query on this table generates the following sql
SELECT t1.Author AS Author, t1.Category AS Category, t1.IsPublished AS IsPublish
ed, t1.DatePublished AS DatePublished, t1.Title AS Title, t1.Content AS Content,
t1.ID AS ID
FROM BlogEntries t1
WHERE t1.IsPublished = :p0
-- p0: Input Int32 (Size = 0; DbType = Int32) [True]
-- Context: Devart.Data.SQLite.Linq.Provider.SQLiteDataProvider Model: ao Build:
2.20.11.0
and consequently, nothing is matched irrespective if i put in true or false
This is the code snippet I am using
Data.DataContext dx = new Data.DataContext();
dx.Log = Console.Out;
var r = (from d in dx.Blogentries
where d.Ispublished.Equals(true)
select d);
foreach (var d1 in r)
{
Console.WriteLine(d1.Title);
Console.WriteLine(d1.Ispublished);
}
Running a LINQ query on this table generates the following sql
SELECT t1.Author AS Author, t1.Category AS Category, t1.IsPublished AS IsPublish
ed, t1.DatePublished AS DatePublished, t1.Title AS Title, t1.Content AS Content,
t1.ID AS ID
FROM BlogEntries t1
WHERE t1.IsPublished = :p0
-- p0: Input Int32 (Size = 0; DbType = Int32) [True]
-- Context: Devart.Data.SQLite.Linq.Provider.SQLiteDataProvider Model: ao Build:
2.20.11.0
and consequently, nothing is matched irrespective if i put in true or false
This is the code snippet I am using
Data.DataContext dx = new Data.DataContext();
dx.Log = Console.Out;
var r = (from d in dx.Blogentries
where d.Ispublished.Equals(true)
select d);
foreach (var d1 in r)
{
Console.WriteLine(d1.Title);
Console.WriteLine(d1.Ispublished);
}