Thursday, September 10, 2009 6:34 PM
Is the 2100 parameter limit when using IEnumerable.Contains() issue going to be addressed in .NET 4.0?
UPDATE: For those who are interested in a simple example that demonstrates this problem try the following query in a test program or using LinqPad.
from c in Customer where Enumerable.Range(0, 2100).Contains(c.ID) select c
In LinqPad you will see the following error.
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.
- Edited by kainhart Thursday, March 25, 2010 2:49 PM Added example if the issue
Wednesday, September 16, 2009 5:03 AMModeratorI don't personally recall seeing that particular bug in the database but it isn't in the list of fixes I have that made it into .NET 4.0.[)amien
- Marked As Answer by Damien GuardModerator Wednesday, September 16, 2009 5:03 AM
Wednesday, September 16, 2009 12:09 PMThanks for the honest response. I guess that means that I'll have to get started on developing some sort of workaround that we can use until the next version of .NET after 4.0 assuming that it is fixed there.
Also I suppose it might be a bit to early to ask but from what I've heared, ADO.NET Entity Framework was supposed to get similar support for translating the IEnumerable.Contains method. If it's not too much trouble could we get some confirmation on whether we can expect this same 2100 item limitaion with Entity Framework 4.0? If not that may be a big reason for us to consider migrating our application to Entity Framework.
Wednesday, September 16, 2009 4:56 PMModeratorAnswered in the EF forum at http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/b5e89594-f638-46de-9ffd-4b07ed28ec68?prof=required