We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Using IQueryable

Thread ID:





108161 Apr 7,2013 04:59 PM UTC Apr 9,2013 10:33 AM UTC ASP.NET MVC (Classic) 2
Tags: Grid
Tony Basallo
Asked On April 7, 2013 04:59 PM UTC

I'm trying to use the grid to efficiently access the database. I have no need to request/query all the records when I only need a few. However, I can't seem to find a way to correctly work with IQueryable.

This post/sample (106580) uses the following code (which seems ok at first):

    int pagesize = args.PageSize == 0 ? 12 : Convert.ToInt32(args.PageSize);
    IEnumerable data = new NORTHWNDEntities().Orders.Take(200).ToList();
    IQueryable ds = data.AsQueryable();
For this to truly work as expected - I should be able to build up an SQL statement that I then execute. But that will not work here.
Before you even start, you've already requested 200 records (without any sort of criteria) and then you begin your expressions. Those 200 records may not even have the records I want to filter. 
I tried skipping that part, but it will not run. No records are returned if I try to ToList it at the end.
I'm using MVC4, ASP.NET4, 2013.1
So how does one use IQueryable (with something like EF5/6) to correctly use it's querying features.

Tony Basallo
Replied On April 7, 2013 05:29 PM UTC

It seems I can get what I expect - build up a SQL state and execute just that by finishing up with this:

ds1 = (IQueryable<T>)ds;
Where T is the type being returned. This works perfect.
Not sure how this applies to other ORMs, but with EF, this works as expected.

Eswari S [Syncfusion]
Replied On April 9, 2013 10:33 AM UTC

Hi Tony,


Thanks for your interest in Syncfusion products.


We have provided response to your query in the incident 106696.


Could you please follow up with the incident.


Please let us know if you have any queries.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon