[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Simon Slavin
On 30 Mar 2016, at 6:35pm, Tim Stowell wrote: > SELECT TOP (20) [t0].[field1], [t0].[ field1], [t0].[field2] FROM [tablename] > AS [t0] > > Instead of the "TOP" keyword it should be "LIMIT" Hmm. I'd just like to point out that the syntax diagram for SQLite says that the LIMIT clause must

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Tim Stowell
> The SQLiteConnection class has no "provider" connection string property. > Also, the DataContext class appears to be part of the LINQ-to-MSSQL > feature. > > You probably want to use the ObjectContext class. Thanks for the help. The ObjectContext class appears to be part of Entity Framework, I

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Tim Stowell
> Maybe it's somehow using LINQ-to-MSSQL instead? What does the C# code > look like that is actually performing the LINQ query? That would make sense. I'm actually using the dynamic linq library. First I get a context then I perform select and take operations on it var dbConnection = new

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Tim Stowell
> As far as I can tell, this cannot currently be generated by the > System.Data.SQLite.Linq (or EF6) assembly. In the past, I believe there was > an issue where it would not emit the LIMIT clause; however, that was fixed > long ago. > > Perhaps the project is picking up an outdated version of the

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Tim Stowell
> Are you using the latest System.Data.SQLite? Yes it's the newest package from Nuget, version 1.0.99 > Do you have an example of the generated SQL? It basically looks like this: SELECT TOP (20) [t0].[field1], [t0].[ field1], [t0].[field2] FROM [tablename] AS [t0] Instead of the "TOP" keyword

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Joe Mistachkin
Tim Stowell wrote: > > var dbConnection = new SQLiteConnection( > "Data Source=db;provider=System.Data.SQLite.Linq;"); > var context = new DataContext(dbConnection); > The SQLiteConnection class has no "provider" connection string property. Also, the DataContext class appears to be part of the

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Joe Mistachkin
Tim Stowell wrote: > > Thanks for the response, the strange thing is the System.Data.SQLite.Linq > dll doesn't seem to be getting used at all. If I remove the dll file from > my bin output folder there are no errors when I refresh the site. If I > remove System.Data.SQLite.dll then I get an

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-30 Thread Joe Mistachkin
Tim Stowell wrote: > > SELECT TOP (20) [t0].[field1], [t0].[ field1], [t0].[field2] FROM > [tablename] AS [t0] > > Instead of the "TOP" keyword it should be "LIMIT" > As far as I can tell, this cannot currently be generated by the System.Data.SQLite.Linq (or EF6) assembly. In the past, I

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-28 Thread Joe Mistachkin
Tim Stowell wrote: > > var queryable = table.Skip(20); // Incorrect SQL generated > Are you using the latest System.Data.SQLite? Do you have an example of the generated SQL? -- Joe Mistachkin

[sqlite] calling Skip() on IQueryable with LINQ is generating incorrect sql

2016-03-28 Thread Tim Stowell
I?m using SQLite with .NET and LINQ. When I call Skip on an IQueryable, the generated SQL uses ?TOP? instead of ?Limit? which is causing an error due to SQLite not supporting the Top keyword. I have referenced both System.Data.SQLite, System.Data.SQLite.Linq, and System.Data.Linq in the Visual