oibo8x / subsonicproject

Automatically exported from code.google.com/p/subsonicproject
0 stars 0 forks source link

SQL Server 2005-style paging does not work on SQL Server 2008 #30

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect to an SQL Server 2008 database.
2. Write code that uses SqlQuery and paging.
3. Execute the code.

What is the expected output? What do you see instead?
Instead of the 2005-style paging, the old style is used.

What version of the product are you using? On what operating system?
SubSonic 2.1 Final on Windows XP SP3.

Please provide any additional information below.

The problem is that the Sql2008Generator inherits from ANSISqlGenerator 
but does not override the BuildPagedSelectStatement() function like the 
Sql2005Generator does.

Original issue reported on code.google.com by master...@gmail.com on 30 Jul 2008 at 3:53

GoogleCodeExporter commented 9 years ago
I also had to change line 199 of Utility.cs:
        public static bool IsSql2008(DataProvider provider)
        {
            return provider.DatabaseVersion.IndexOf("2008 - 10.") > -1 || 
                provider.DatabaseVersion.IndexOf("2008 (RTM) - 10.") > -1;
        }

My database version had an extra (RTM) in version description. 

Original comment by jason.ke...@gmail.com on 14 Mar 2009 at 4:31

GoogleCodeExporter commented 9 years ago
I've implemented jason.kealey's changes in r498 to better detect 2008.

Original comment by johnshee...@gmail.com on 8 Apr 2009 at 6:18