Data adaptor with compatibility levels

Hello,

I have a problem when using a custom data adapter:


if (dataManagerRequest.Skip != 0)

        {

            //Paging

            DataSource = DataOperations.PerformSkip(DataSource, dataManagerRequest.Skip);

        }

        if (dataManagerRequest.Take != 0)

        {

            DataSource = DataOperations.PerformTake(DataSource, dataManagerRequest.Take);

   }


When I perform the actions to skip and take, i get the following error:

Microsoft.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'OFFSET'.

Invalid usage of the option NEXT in the FETCH statement.

The row that throws the exception is this one:

OFFSET @__p_0 ROWS FETCH NEXT @__p_0 ROWS ONLY

I understand that this is due to an older version of the SQL Server I am connecting to, in this case version 90 (SQL Server 2005).

Is there a workaround? Or a way to specify the compatibility level in the Data Adaptor?

Thanks in advance.



1 Reply

MS Monisha Saravanan Syncfusion Team February 3, 2023 09:15 AM UTC

Hi Lucio,


We believe the issue might be related to the SQL version being used. We have identified a common reference that might help to resolve the issue. Kindly check the below attached reference.


Common Reference: https://stackoverflow.com/questions/53349099/incorrect-syntax-near-offset-invalid-usage-of-the-option-next-in-the-fetch-st


Please let us know if you face any difficulties.


Regards,

Monisha


Loader.
Up arrow icon