The runtime framework (3.0) gives me the SqlException "The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100." (using SQL Server 2008 ).
This is because a "SELECT ... WHERE Id IN {more than 2100 values}" query is used in the following code:
var entities = new EntityCollection<ProductsEntity>();
SortExpression sorter = null;
using(var adap = new DataAccessAdapter())
{
sorter = new SortExpression(new SortClause(ProductsFields.Id, null, SortOperator.Ascending));
var prefetchPath = new PrefetchPath2(EntityType.ProductsEntity);
prefetchPath.Add(ProductsEntity.PrefetchPathBrands); // Product 1:m Brand
// Exception occurs if I add this:
prefetchPath.Add(ProductsEntity.PrefetchPathProductPrices); // Product 1:n ProductPrice
adap.FetchEntityCollection(entities, new RelationPredicateBucket(), 0, sorter, prefetchPath, 1, 5000);
}
Why doesn't that use a SQL paging query ("LIMIT")? If I remove the line after ###, it works without a problem. Any solution or workaround?