Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6551889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:23:36+00:00 2026-05-25T12:23:36+00:00

I have started to use telerik grids recently (for ASP.NET MVC). The ‘Linq-based expression

  • 0

I have started to use telerik grids recently (for ASP.NET MVC). The ‘Linq-based expression engine’ does all the heavy lifting for you: paging, sorting and filtering. It just needs to be hooked up with a repository method like this:

public IEnumerable GetBlas()
{
return Session.Query();
}

I have the following problem now. I would like to use ICriteria and Restrictions.In(“x”, list.ToArray()) where list is of type IList and is populated by another process. The problem is that list can contain hundreds of values and this might throw an exception as the generated SQL code’s ‘IN PART’ (e.g. IN (1, 2, ….., 10000)) might be far too long.

Is there a way to implement this without having to switch to pure SQL and dealing with all the query strings etc. the telerik grid sends? Hope this makes sense.

Thanks.

Christian

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:23:36+00:00Added an answer on May 25, 2026 at 12:23 pm

    The idea is to divide the list of 10,000 items into smaller lists of (say) 1000 items each.
    The easiest way to do the query is using ICriteria, where you can add as many Disjunctions as you need for each sub-collection you have.

    If ICriteria is not an option, there can be a workaround where you create multiple Future queries, like so (tested code, which does only 1 roundtrip to the db):

    string [] names = {"boris", "admin", "scheduleuser"}, moreNames = {"adminuser"};
    var x = session.Query<User>()
                    .Where(u => names.Contains(u.Name)).ToFuture();
    
    var y = session.Query<User>()
                    .Where(u => moreNames.Contains(u.Name)).ToFuture();
    
    var res = x.Union(y);
    
    log.DebugFormat("found {0} users. 1st user is : {1}", res.Count(), res.Count() > 0 ? res.First().FullName : "none");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started to use Web Expression 4. I was under the impression
I have started a new mvc project and clicked on project\properties\web - use local
I have recently started looking into Google Charts API for possible use within the
I've just started to use linq to sql and have run into a problem
I have started to use prepared statements in my php,mysql based application. As I
I have recently started to use Kohana and I know inheritance is in infancy
I have written a simple test application using asp.net mvc with C#. The application
I have recently started to use Nhibernate and i am quite happy with it
I have recently started to use the code cell function in MATLAB's editor and
I have an MVC app and I have started to use DTOs exclusively to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.