문제

I am using a Silverlight DataGrid with a DomainDataSource and a DataPager and EF 4 When using MSSQL server profiler, I noticed 2 queries which we taking the bulk of the data retrieval time. One query gets the data for the given load size, and another which gets the total page count. The one getting the page count is very slow for large sets of data, much slower than getting the data itself!

So my question is this: Is it possible to suppress this query? I know the datapager needs to know how many pages there are but I think I can work around that if I have to

Thanks

도움이 되었습니까?

해결책

setting 'IncludeTotalCount' on the query to false worked. I did this in the override method of Load in the database context but iguess it can be done on a specific query.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top