cancel
Showing results for 
Search instead for 
Did you mean: 

Linq query fails on proxy table

Former Member
3,096

Using EF SQL Anywhere Data Provider a linq query fails on retrieving data from a proxy table. It only fails if the query results in more than one rows.

  InnerException: iAnywhere.Data.SQLAnywhere.SAException
       Message=Cursor is restricted to FETCH NEXT operations
       Source=SQL Anywhere .NET Data Provider
       ErrorCode=-2147467259
       NativeError=-668
       StackTrace:
            at iAnywhere.Data.SQLAnywhere.SADataReader.Read()
            at System.Data.Common.Internal.Materialization.Shaper`1.StoreRead()

Both the databases (the one in which the query is run and the remote server) are SA12 (12.0.1.3742) databases. If I copy the proxy table (structure and data) and replace it as an ordinary table, the query is run with success.

This leads me towards the issue being with the EF data provider which turns the query to a cursor declaration which fails.

Linq Query:

var obPersonFiles = (from files in sybaseModel.OB_PERSON_FILE
                      where files.EMPLOYMENT_SEQ == employmentSeq && files.DOCUMENT != null
                     select files).ToList();

Table structure:

Accepted Solutions (0)

Answers (0)